Jump to content

OldGrim

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by OldGrim

  1. This is the output of var_dump($data); array(3) { ["post_id"]=> string(2) "35" ["post_title"]=> string(8) "Fake Day" ["post_date"]=> string(10) "2021-04-01" } bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) array(3) { ["post_id"]=> string(2) "36" ["post_title"]=> string(12) "Carbon Tales" ["post_date"]=> string(10) "2021-04-18" } bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false)
  2. CMS: PHP-Fusion version 9.03.110, PHP version: 7.4.16, MySQL Server Version: 5.7.33-log, DB Driver: PDO MySQL My own support people at PHP-Fusion main site have been unable to help me with this problem and I'm hoping for some new eyes and new input on this error. First of all my script works perfectly fine and outputs the result desired. I know that my script is not using PDO prepared statements and I am not prepared to modify it to do so because too much would have to be changed. And I'm not fluent on PDO. My script is an event calendar and can be seen at this url: https://windy.whisperwillow.net/grims_blog/index.php The error only occurs 3 times on 3 lines. <?php echo "<div class='col-sm-12'>\n"; include BASEDIR."grims_blog/include/cal_func_inc.php"; $day=date('d'); $endDate=date('t',mktime(0,0,0,$cMonth,$day,$cYear)); echo "<div><span class='hdspan2'><b>".$locale['gb_510']."</b></span></div><p>\n"; echo "<table class='tbl-responsive' width='67%' align='center' border='0' cellpadding='0' cellspacing='0'><tr>\n"; echo "<td align='center' colspan='3'><img style='max-width:100%;height:auto;' src='".BASEDIR."grims_blog/images/calhead/forest.jpg'></td>\n"; echo "</tr><tr height='30' bgcolor='#960000'>\n"; echo "<td align='left'>&nbsp;<a class='mcaldate' href='".FUSION_SELF."?month=$prev_month&amp;year=$prev_year' title='Last Month'>".$locale['gb_511']."</a></td><td align='center'><span class='mnthhd'>".date("F Y",strtotime($cYear."-".$cMonth."-01"))."</span></td><td align='right'><a class='mcaldate' href='".FUSION_SELF."?month=$next_month&amp;year=$next_year' title='Next Month'>".$locale['gb_512']."</a>&nbsp;</td>\n"; echo "</tr></table>\n"; echo "<table width='67%' align='center' border='0' cellpadding='0' cellspacing='0'><tr><td class='cal-blank'>\n"; echo "<table width='100%' align='center' border='0' cellpadding='0' cellspacing='0'><tr bgcolor='#005E00' height='35'>\n"; foreach ($short_days as $key=>$val) { echo "<th style='text-align:center' width='14%'><span style='font-size:12px; color:yellow;'><b>".$val."</b></span></th>\n"; } echo "</tr><tr>\n"; $s=date('w', mktime (0,0,0,$cMonth,1,$cYear)); for ($ds=1; $ds<=$s; $ds++) { echo "<td class='cal-blank' height='35' style='text-align:center;' valign='middle'></td>\n"; } for ($d=1; $d<=$endDate; $d++) { if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 0) { echo "<tr>\n"; } $result = dbquery("SELECT post_id, post_title, post_date FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = '$cMonth' AND DAY(post_date) = '$d'"); $data = dbarray($result); $stuff1 = $data['post_id'] ? $data['post_id'] : ""; if ($stuff1) { $id = $stuff1; } else { $id = ""; } $stuff2 = $data['post_title'] ? $data['post_title'] : ""; if ($stuff2) { $title = $stuff2; } else { $title = ""; } $stuff3 = strtotime($data['post_date']) ? strtotime($data['post_date']) : ""; if ($stuff3) { $evday = $stuff3; } else { $evday = ""; } if (date("d", intval($evday)) == $d) { echo "<td height='35' class='event' align='center' valign='middle'>\n"; } elseif ($d == $day && $cMonth == date('m') && $cYear == date('Y')) { echo "<td height='35' class='today' align='center' valign='middle'>\n"; } else { echo "<td height='35' class='cal-norm' align='center' valign='middle'>\n"; } if ($d == $day && $cMonth == date('m') && $d <> $evday) { echo "<a class='cal2' href='".BASEDIR."grims_blog/filtered.php?post_id=$id' title='".$locale['gb_513']." $title'><b>$d</b></a>\n"; } elseif ($d == $day && $cMonth == date('m') && $d == $evday) { echo "<a class='cal2' href='#'><b>$d</b></a>\n"; } elseif ($evday) { echo "<a class='ecal' href='".BASEDIR."grims_blog/filtered.php?post_id=$id' title='$title'><b>$d</b></a>\n"; } else { echo "<span class='noevt'><b>$d</b></span>\n"; } echo "</td>\n"; if (date('w',mktime (0,0,0,$cMonth,$d,$cYear)) == 6) { echo "</tr>\n"; } } echo "</table></td></tr></table>\n"; echo "</td></tr></table><p></div>\n"; ?> Well I could not add comments to the posted script. These 3 lines of the db query area give the error in my error log: 1) $stuff1 = $data['post_id'] ? $data['post_id'] : ""; /* Trying to access array offset on value of type bool */ 2) $stuff2 = $data['post_title'] ? $data['post_title'] : ""; /* Trying to access array offset on value of type bool */ 3) $stuff3 = strtotime($data['post_date']) ? strtotime($data['post_date']) : ""; /* Trying to access array offset on value of type bool */ I know I am asking a lot for help on older code but would really appreciate it if someone can take a look.
  3. One final note: We did change it Barand, When any previous month is selected and then an active date in that month is clicked, instead of 'filtered.php' it now pulls up our 'archive_files.php' then from there the month archive desired is clicked. Our little problem is now solved and our calendar scripts, indeed the entire blog system is now ready for production. Thanks once again for all your help. 😉
  4. Check out my blog site when you get a chance Barand. Everything now works correctly. I have a friend that lives in California and we, together developed this blog and calendar. He has been working on it on his localhost setup on his computer. He took your calendar code as is and it works correctly on his computer so he sent me his calendar.php file to test on my live system and it works beautifully !!! I made the mistake of trying to split things up too much. (old habits die hard)... at any rate this project is now truly complete with all aims accomplished. Thank you so very much Barand. We really appreciate all your hard work. I wish my php skills were anywhere near your skill level.
  5. OK... when I do view page source this is what I see: <link rel='stylesheet' href='../../infusions/grims_blog/css/public_styles.css' type='text/css' /> 0</head> <body> See the zero before </head> ? It's not loading the script for some reason.
  6. OK got that done but still not working. When I click a date in Prev month the calendar still goes back to Dec. The url in the top is then: https://whisperwillow.net/infusions/grims_blog/filtered.php?post_id=3&date= It's not picking up the new date function.
  7. Doesn't quite work yet. Error code: [10-Dec-2020 16:28:41 Europe/London] PHP Parse error: syntax error, unexpected '").click( function() { (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in /home/whisperw/public_html/infusions/grims_blog/index.php on line 42 This is my new index.php file: <?php /*-------------------------------------------------------+ | PHP-Fusion Content Management System | Copyright © 2002 - 2014 Nick Jones | http://www.php-fusion.co.uk/ +--------------------------------------------------------+ | Filename: index.php | Copyright © 2020 Grimloch | https://www.whisperwillow.com +--------------------------------------------------------+ | This program is released as free software under the | Affero GPL license. You can redistribute it and/or | modify it under the terms of this license which you | can read by viewing the included agpl.txt or online | at www.gnu.org/licenses/agpl.html. Removal of this | copyright header is strictly prohibited without | written permission from the original author(s). +--------------------------------------------------------*/ require_once "../../maincore.php"; include INFUSIONS."grims_blog/infusion_db.php"; if (file_exists(INFUSIONS."grims_blog/locale/".$settings['locale'].".php")) { include INFUSIONS."grims_blog/locale/".$settings['locale'].".php"; } else { include INFUSIONS."grims_blog/locale/English.php"; } echo "<!DOCTYPE html>\n"; echo "<html>\n"; echo "<head>\n"; echo "<title>".$locale['gb_200']."</title>\n"; echo "<meta content='text/html'>\n"; echo "<meta charset='UTF-8' />\n"; echo "<meta name='viewport' content='width=device-width, initial-scale=1'>\n"; echo "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css'>\n"; echo "<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>\n"; echo "<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js'></script>\n"; echo "<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js'></script>\n"; echo "<link rel='stylesheet' href='".INFUSIONS."grims_blog/css/public_styles.css' type='text/css' />\n"; echo "<script type='text/javascript'> $().ready( function() { $(".multiblog").click( function() { var blogs = $(this).data('blogs') var date = $("#cal-date").val() $("#blogmenu").hide() $("#blogmenu").position({"Top":0, "Left":0}) $("#blogmenu").html("<b>Select blog:</b><br>") $.each(blogs, function(k,v) { $("#blogmenu").append("<p><a class='lnkc' href='../grims_blog/filtered.php?post_id="+k+"&date="+date+"'>"+v+"</a></p>") }) var pos = $(this).position() $("#blogmenu").css("display","inline-block") $("#blogmenu").offset( {"top": pos.top+25, "left": pos.left} ) }) $("#blogmenu").click( function() { $("#blogmenu").html("<b>Select blog:</b><br>") $("#blogmenu").hide() $("#blogmenu").position({"Top":0, "Left":0}) }) }) </script>\n"; echo "</head>\n"; echo "<body>\n"; echo "<div id='wrapper'>\n"; echo "<div id='head'>\n"; include INFUSIONS."grims_blog/include/header.php"; echo "</div>\n"; echo "<div class='row'>\n"; echo "<div class='col-sm-9'>\n"; echo "<div id='card-left'>\n"; echo "<div align='center'><h4><span style='color:#B83C32;'><b><u>Current Month Blogs</u></b></span></h4></div>\n"; $result = dbquery("SELECT * FROM ".DB_GRIMS_BLOG_POST." WHERE active='1' AND MONTH(post_date) = MONTH(CURDATE()) ORDER BY post_date DESC"); if (dbrows($result)) { $cnt = 0; while($data = dbarray($result)) { $post_id = $data['post_id']; $topic_id = $data['topic_id']; $title = $data['post_title']; $content = $data['post_body']; $image = $data['post_img']; $thumb = $data['post_thb']; $timestamp = strtotime($data['post_date']); $result1 = dbquery("SELECT * FROM ".DB_GRIMS_BLOG_TOPICS." WHERE topic_id='$topic_id'"); list($topic_id, $topic_title) = dbarraynum($result1); $id = $topic_id; $name = $topic_title; $result2 = dbquery("SELECT * FROM ".DB_GRIMS_BLOG_COMMENTS." WHERE post_id='$post_id' AND topic_id='$topic_id'"); $num_rows = mysql_num_rows($result2); echo "<a class='cats' href='filtered.php?post_id=".$post_id."'>$title</a><br />\n"; if ($image) { echo "<span><img src='".THBPATH."$thumb' style='max-width:100%;height:auto;'></span><br />\n"; } echo "<span class='cmnt-lnk'>".$locale['gb_201']."<a class='tpic-lnk' href='topics_page.php?topic_id=".$id."'>$name</a> on ".date("F d, Y", $timestamp)."</span><br />\n"; echo "<table cellpadding='5'><tr><td bgcolor='#fff'><table width='100%' cellpadding='8' border='0'>\n"; echo "<tr><td style='padding:5px; font-size:16px;'>".html_entity_decode(stripslashes($content))."</td></tr>\n"; echo "<tr><td style='background:#fff; padding:5px; font-size:16px;'><span class='info'><b><a class='tpic-lnk' href='comments.php?post_id=".$post_id."'>".$locale['gb_215']."</a> ($num_rows)</b></span></td></tr>\n"; echo "</table></td></tr></table><p></p>\n"; } $cnt++; } echo "</div></div>\n"; echo "<div class='col-sm-3'>\n"; echo "<div id='card-rite'>\n"; include INFUSIONS."grims_blog/include/calendar.php"; echo "</div>\n"; echo "<div id='card-rite'>\n"; include INFUSIONS."grims_blog/include/topics.php"; echo "</div>\n"; echo "<div id='card-rite'>\n"; include INFUSIONS."grims_blog/include/latest_blogs.php"; echo "</div>\n"; echo "<div id='card-rite'>\n"; include INFUSIONS."grims_blog/include/latest_comments.php"; echo "</div>\n"; echo "</div></div>\n"; include INFUSIONS."grims_blog/include/footer.php"; echo "</div>\n"; echo "</body>\n"; echo "</html>\n"; ?> And this is my new calendar.php file: <?php include"cal_config.php"; $pdo = pdoConnect(); $today = new DateTime( $_GET['date'] ?? '' ); $prev = (clone $today)->modify('-1 month')->format('Y-m-d'); $next = (clone $today)->modify('+1 month')->format('Y-m-d'); $caption = $today->format('F Y'); $this_month = $today->format('n'); $day1 = (clone $today)->modify("first day of this month"); $queryStart = $day1->format('Y-m-d'); if ($day1->format('w') != 0) { $day1->modify('last Sunday'); } $dayN = (clone $today)->modify('last day of this month'); $queryEnd = $dayN->format('Y-m-d'); if ($dayN->format('w') != 6) { $dayN->modify('next sunday'); } $period = new DatePeriod($day1, new DateInterval('P1D'), $dayN); // calendar display dates ## get this month's blogs $blogs = []; $res = $pdo->prepare("SELECT post_id , post_date as day , post_title FROM ".DB_GRIMS_BLOG_POST." WHERE post_date BETWEEN ? AND ? ORDER BY post_date "); $res->execute( [ $queryStart, $queryEnd ] ); foreach ($res as $r) { if (!isset($blogs[$r['day']])) { $blogs[$r['day']] = []; } $blogs[$r['day']][] = $r; } ## Functions function calheads() { $out = '<tr>'; $days = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]; foreach ($days as $d) { $out .= " <th style='text-align:center; color:yellow;' abbr='$d' title='$d'>{$d[0]}</th>"; } return $out; } function caldata($per, $mth, &$blogs) { $i = 0; $out = ''; foreach ($per as $d) { if ($i%7 == 0) { if ($out != '') $out .= "</tr>\n"; $out .= "<tr>"; } ++$i; $dno = $d->format('d'); $cls = $link = $title = $datablog = ''; $dbArr = []; if ($d->format('n') != $mth) { $cls .= 'blank '; } else { $cls .= 'daycell '; if ($d->format('Y-m-d') == date('Y-m-d')) $cls .= 'today '; if (isset($blogs[$d->format('Y-m-d')])) { $dayblogs = $blogs[$d->format('Y-m-d')]; $cls .= 'active '; if (count($dayblogs)==1) { $title = $blogs[$d->format('Y-m-d')][0]['post_title']; $dno = "<a class='lnkc' href='../grims_blog/filtered.php?post_id={$blogs[$d->format('Y-m-d')][0]['post_id']}&date=$date'>$dno</a>"; } else { $title = join("\n", array_column($dayblogs,'post_title')); $cls .= 'multiblog '; foreach ($dayblogs as $dba) { $dbArr[$dba['post_id']] = $dba['post_title']; } $datablog = json_encode($dbArr); } } } $out .= "<td class='$cls' title='$title' data-blogs='$datablog'>$dno</td>\n"; } $out .= "</tr>\n"; return $out; } echo "<div class='row'>\n"; echo "<table width='100%' border='0'><tr>\n"; echo "<td align='center'><span style='font-size:16px; color:#FCF9B6;'><b>Calendar</b></span><p>\n"; echo "<table width='63%' border='1' cellpadding='5'><tr>\n"; echo "<td bgcolor='#AFAFAF'><table width='100%' cellpadding='4' border='1'><tr>\n"; echo "<td><input type='hidden' id='cal-date' value='$today->format('Y-m-d')'>\n"; echo "<caption style='text-align:center; font-size:16px; background:#B83C32; color:#fff;'><a id='navbtn1' href='?date=$prev'>&laquo;</a>".$caption."<a id='navbtn2' href='?date=$next'>&raquo;</a></caption>\n"; echo "<thead bgcolor='#005500'>".calheads()."</thead>\n"; echo "<tbody align='center' bgcolor='#000'>".caldata($period, $this_month, $blogs, $today->format('Y-m-d'))."</tbody>\n"; echo "</table></td></tr></table>\n"; echo "</td></tr></table>\n"; echo "<div id='blogmenu'></div>\n"; echo "<br /><br /></div>\n"; ?> So I'm a little confused at this point. All I get is a white screen.
  8. Hello; good morning Barand. I have one more question, the answer to which I fear will be no but will ask anyway. When viewing my blog; if the Prev arrow is clicked which gives the month of November the articles for Nov. are shown on the calendar. If a linked day is then clicked it pulls up that article in the center column as it should however; the calendar display defaults back to the current month so only one link can be clicked in Prev mode. Question: Is there anyway to make the calendar stay on the Prev month? If the answer is yes then I realize it probably entails using jQuery somehow. but I would have no idea how to implement that coding.
  9. Message Reply: Yes we liked it very much after figuring out how to implement it in our CMS. It took some tweaking but the end result is much better than I had hoped for. Thank you very very much. I used Freaks many years ago and was always impressed by the quality and knowledge of the people here. Only showing one link per day is fine. Again thanks !!! Case closed.
  10. On second thought I really do need to learn PHP PDO. Considering your post above how would I change it to reflect my actual data which follows: /********************************* MY TABLE DATA ***************************************** +--------------------+-----------+-------------+-------------+-----------+ | post_topic_id | post_id | topic_id | art_mon | art_day | | 1 1 1 9 4 |------------------------- | 2 2 2 9 9 | 3 articles in Sep 4, 9 & 27 | 3 3 5 9 27 |-------------------------- | 4 4 4 10 11 |--------2 articles----- both on | 5 6 3 10 11 |-----------in Oct------- the 11th | 6 12 2 11 23 |-------------------------- | 7 13 6 11 24 | 4 articles | 8 8 3 11 1 | in Nov 1, 7, 23 & 24 | 9 9 4 11 7 |-------------------------- | 10 14 4 12 1 |--------2 articles----- | 11 15 4 12 3 |---------in Dec-------- 1 & 3 +--------------------+-----------+-------------+-------------+-----------+ ******************************************************************************************************/ All I need from this table is the following: current month(art_mon) 1 or 2 digits depending on month day(art_day) 1 or 2 digits depending on day and the (post_id) 1 or 2 digits depending on article post +----------------------------------------------------------------------------------------------------+ As I said before this data is inserted in this table at post creation time The post_id is gleaned from the last inserted article post_id. Code follows: +----------------------------------------------------------------------------------------------------+ $posted = time(); $result = dbquery("INSERT INTO ".DB_GRIMS_BLOG_POST." (post_id, topic_id, post_title, post_body, post_img, post_thb, posted, active) VALUES ('', '$topic_id', '$post_title', '$post_body', '$post_img', '$post_thb', '$posted.', '$active')"); $last_id = db_lastid(); $mymon = date("n", $posted); $myday = date("j", $posted); $result = dbquery("INSERT INTO ".DB_GRIMS_BLOG_POST_TOPIC." (post_topic_id, post_id, topic_id, art_mon, art_day) VALUES ('', '$last_id', '$topic_id', '$mymon', '$myday')"); I know this is a long shot but if you could help me one more time I would be SO GRATEFUL!
  11. You know I really really appreciate all your hard work on this. The CMS I'm running is PHP-Fusion and all though our system is PDO based I have never never used pdo prepared statements even though I know about it. I don't see how I can suddenly completely redo all my calendar code as you suggest. I tried using some of the ideas from your code but so far no luck. I suppose I'm just going to have to abandon my idea of making my calendar clickable.
  12. What I mean is the calendar display is the same as if the code weren't there. The code does nothing. It is supposed to make the day of an article a link which when clicked pulls up that article. Here's a link to see my calendar. https://whisperwillow.net/infusions/grims_blog/index.php The highlighted day is today's date. In my db table the month is 'art_mon' for article month 'tinyint(2)'. The day is 'art_day' for article day 'tinyint(2)' and of course 'post_id' is the article id (int(10). All of these values are inserted into the db table when a new article is posted. The calendar script is not mine and was not written to have linked events(articles) in my case and I am trying to add that capability. The month of December so far has 2 articles posted on the 1st and the 3rd so those 2 days in the calendar should link to those 2 articles. Using this coding in a test file: $time = time(); $moz = date('n', $time); $main = '$days = array('; $endmain = ');'; $result = dbquery("SELECT * From ".DB_GRIMS_BLOG_POST_TOPIC." WHERE art_mon='11'"); if (dbrows($result)) { $na = array(); while($data = dbarray($result)) { $mdata = array(); $dah = $data['art_day']; $pst = $data['post_id']; $mdata = "&lt;a href='https://whisperwillow.net/infusions/grims_blog/filtered.php?post_id=$pst'&gt;$dah&lt;/a&gt;"; $na[] = $mdata; } } echo $main.'<br>';foreach($na as $x => $value) {echo $value.'<br>';}echo $endmain; I can get this result: $days = array( <a href='https://whisperwillow.net/infusions/grims_blog/filtered.php?post_id=12'>23</a> <a href='https://whisperwillow.net/infusions/grims_blog/filtered.php?post_id=13'>24</a> <a href='https://whisperwillow.net/infusions/grims_blog/filtered.php?post_id=8'>1</a> <a href='https://whisperwillow.net/infusions/grims_blog/filtered.php?post_id=9'>7</a> ); This is for the month of November. However using this coding in another calendar script I've tried it doesn't work either because the above is actually one long string instead of an array. I thought about trying to use eval but I have no experience with it and am concerned about the warnings of using it.
  13. I have a simple php calendar script that works great however, I need to make the dates clickable referencing a db tables data. I tried changing the for loop to a while loop with no success so I am now trying to work with the for loop to make the dates (links); here is my complete script (using it as a calendar plugin) with comments to show my re-coding attempt. <?php $time = time(); $numDay = date('d', $time); $numMonth = date('m', $time); $strMonth = date('F', $time); $numYear = date('Y', $time); $firstDay = mktime(0,0,0,$numMonth,1,$numYear); $daysInMonth = cal_days_in_month(0, $numMonth, $numYear); $dayOfWeek = date('w', $firstDay); echo "<div class='row'>\n"; echo "<table width='100%' border='0'><tr>\n"; echo "<td align='center'><span style='font-size:16px; color:#FCF9B6;'><b>Calendar</b></span><p>\n"; echo "<table width='63%' border='1' cellpadding='5'><tr>\n"; echo "<td bgcolor='#AFAFAF'><table width='100%' cellpadding='4' border='1'>\n"; echo "<caption style='text-align:center; font-size:16px; background:#B83C32; color:#fff;'><b>$strMonth $numYear</b></caption>\n"; echo "<thead><tr>\n"; echo "<th style='text-align:center; font-size:12px;' bgcolor='#005500' abbr='Sunday' scope='col' title='Sunday'>S</th>\n"; echo "<th style='text-align:center; font-size:12px;' bgcolor='#005500' abbr='Monday' scope='col' title='Monday'>M</th>\n"; echo "<th style='text-align:center; font-size:12px;' bgcolor='#005500' abbr='Tuesday' scope='col' title='Tuesday'>T</th>\n"; echo "<th style='text-align:center; font-size:12px;' bgcolor='#005500' abbr='Wednesday' scope='col' title='Wednesday'>W</th>\n"; echo "<th style='text-align:center; font-size:12px;' bgcolor='#005500' abbr='Thursday' scope='col' title='Thursday'>T</th>\n"; echo "<th style='text-align:center; font-size:12px;' bgcolor='#005500' abbr='Friday' scope='col' title='Friday'>F</th>\n"; echo "<th style='text-align:center; font-size:12px;' bgcolor='#005500' abbr='Saturday' scope='col' title='Saturday'>S</th>\n"; echo "</tr></thead><tbody><tr>\n"; if($dayOfWeek !=0) { echo "<td style='text-align:center; font-size:12px; color:#000; background:#ddd;' colspan='".$dayOfWeek."'></td>\n"; } for($i=1;$i<=$daysInMonth;$i++) { /* my inserted coding for db query */ $moz = date('n', $time); $result = dbquery("SELECT * From ".DB_GRIMS_BLOG_POST_TOPIC." WHERE art_mon='$moz'"); if (dbrows($result)) { while($data = dbarray($result)) { $dah = $data['art_day']; $pst = $data['post_id']; } if($i == $dah) { "<a href='../grims_blog/filtered.php?post_id=$pst'>$i</a>"; } /* normal script continues */ if($i == $numDay) { echo "<td style='text-align:center; font-size:12px; color:#fff; background:#890000;'><b>\n"; } else { echo "<td style='text-align:center; font-size:12px; color:#000; background:#ddd'><b>\n"; } $padding = $i; $padding = str_pad($padding, 2, '0', STR_PAD_LEFT); echo $padding; echo "</b></td>\n"; /* closing of db query inserted here */ } /* ends here */ if(date('w', mktime(0,0,0,$numMonth, $i, $numYear)) == 6) { echo "</tr>\n"; } } echo "</tbody>\n"; echo "</table></td></tr></table>\n"; echo "</td></tr></table><br /><br /></div>\n"; ?> It doesn't throw an error but it doesn't work either. Any help would be appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.