Dragonfly CMS v9 ⇒ Gamers Modules & Blocks :: Archives ⇒ GEM: Need help with 2 column center block. :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks Gamers Modules & Blocks ⇒ Archives

Archived ⇒ GEM: Need help with 2 column center block.


I obviously need a lot more training on making blocks in DF.

if anyone can help me with this I would be greatful.

I have 2 blocks I want to combine into a center block for my EQ2 guild website.

Here is the first block:

<?php /********************************************* CPG Dragonflyâ„¢ CMS ******************************************** Copyright © 2004 - 2005 by CPG-Nuke Dev Team www.dragonflycms.com Dragonfly is released under the terms and conditions of the GNU GPL version 2 or any later version $Source: /cvs/html/blocks/block-Forums.php,v $ $Revision: 9.7 $ $Author: djmaze $ $Date: 2006/02/16 01:48:39 $ Encoding test: n-array summation ∑ latin ae w/ acute ǽ ********************************************************/ if (!defined('CPG_NUKE')) { exit; } if (!is_active('Forums')) { $content = 'ERROR'; return trigger_error('Forums module is inactive', E_USER_WARNING); } global $db, $prefix, $sitename; $content = ''; $result = $db->sql_query("SELECT t.forum_id, topic_id, topic_title, auth_view, auth_read FROM (".$prefix."_bbtopics AS t, ".$prefix."_bbforums AS f) WHERE f.forum_id=t.forum_id ORDER BY topic_time DESC LIMIT 10"); if ($db->sql_numrows($result) < 1) { $content = 'ERROR'; return trigger_error('There are no forum posts', E_USER_NOTICE); } else { while (list($forum_id, $topic_id, $topic_title, $auth_view, $auth_read) = $db->sql_fetchrow($result)) { if ($auth_view < 2 || $auth_read < 2) { $topic_title = check_words($topic_title); $content .= '<img src="images/arrow.gif" border="0" alt="" />  <a href="'.getlink('Forums&file=viewtopic&t='.$topic_id).'">'.$topic_title.'</a><br />'; } } $content .= '<center><br /><a href="'.getlink('Forums').'"><strong>'.$sitename.' '._BBFORUMS.'</strong></a></center>'; } ?>

And here's the second one.

<?php /* ******************************************** Guild_Event_Manager Block Combined v1.2.0.0 ******************************************** Copyright ©2006 by Stremok Support for this module can be found at: www.eq2caladrius.com/ You must be running the current version of Roster Master for Dragonfly by DarkGrue in order for this module to behave properly. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GEM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ******************************************** */ if (!defined('CPG_NUKE')) { exit; } // Generic user variables and page setup. global $userinfo, $db, $prefix, $baselink, $bgcolor1, $bgcolor2, $bgcolor3, $l10n_gmt_regions; // Hopefully this line works? $module_name = 'GEM'; get_lang($module_name); $cur_theme = $CPG_SESS['theme']; $content = ''; // Kill block if module is not Active. if (!is_active($module_name)) { $content = $module_name.' '._GEM_INACTIVE.'.'; return; } // Get block settings from admin $getSetting = $db->sql_query("SELECT * FROM ".$prefix."_GEM_settings WHERE gemSetID = '1'"); if ($row = $db->sql_fetchrow($getSetting)) { $blkDaysOut = $row['gemBlkDO']; } /**********************************************************************************************/ /**********************************************************************************************/ /**********************************************************************************************/ // Unix timestamps for first and last day of month based on GMT $firstStamp = gmmktime(0, 0, 0, gmdate("m"), 1, gmdate("Y")); $curStamp = time(); $lastStamp = gmmktime(0, 0, -1, gmdate("m")+1, 1, gmdate("Y")); $daysOut = gmmktime(0, 0, 0, gmdate("m"), (gmdate("d") + $blkDaysOut), gmdate("Y")); // Build an array of events to go out as far as determined by admin $sqlEvents = $db->sql_query("SELECT * FROM ".$prefix."_GEM_events WHERE gemStartTime BETWEEN '".$curStamp."' AND '".$daysOut."' ORDER BY gemStartTime ASC"); if ($row = $db->sql_fetchrow($sqlEvents)) { $id = $row['gemEventID']; $timestamp = $row['gemStartTime']; $userStart = GEMdateBlk("D M j, Y", $row['gemStartTime'], $userinfo["user_dst"], $userinfo["user_timezone"]); $numSignup = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_GEM_signups WHERE gemEventID = '".$id."'")); $numCom = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_GEM_comments WHERE gemEventID = '".$id."'")); $content .= '<table cellspacing="0" cellpadding="0" align="center" width="100%"><tr><td align="center"><strong><u>'.$userStart.'</u></strong></td></tr>'; $content .= '<tr><td><a href="'.getlink("GEM&pg=5&eid=$id").'">'.$row['gemTitle'].'</a>'; $content .= '<div align="right">'.GEMdateBlk("g:i a", $timestamp, $userinfo["user_dst"], $userinfo["user_timezone"]).' '.substr($l10n_gmt_regions[$userinfo["user_timezone"]], strpos($l10n_gmt_regions[$userinfo["user_timezone"]], "("), strpos($l10n_gmt_regions[$userinfo["user_timezone"]], ")")).')</div>'; $content .= '<div align="right"><img src="images/GEM/chars.png" alt="" title="" />='.$numSignup.'     <img src="images/GEM/coms.png" alt="" title="" />='.$numCom.'</div></td></tr>'; while ($row = $db->sql_fetchrow($sqlEvents)) { $id = $row['gemEventID']; $timestamp = $row['gemStartTime']; $numSignup = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_GEM_signups WHERE gemEventID = '".$id."'")); $numCom = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_GEM_comments WHERE gemEventID = '".$id."'")); if (GEMdateBlk("D M j, Y", $row['gemStartTime'], $userinfo["user_dst"], $userinfo["user_timezone"]) == $userStart) { $content .= '<tr><td><a href="'.getlink("GEM&pg=5&eid=$id").'">'.$row['gemTitle'].'</a>'; $content .= '<div align="right">'.GEMdateBlk("g:i a", $timestamp, $userinfo["user_dst"], $userinfo["user_timezone"]).' '.substr($l10n_gmt_regions[$userinfo["user_timezone"]], strpos($l10n_gmt_regions[$userinfo["user_timezone"]], "("), strpos($l10n_gmt_regions[$userinfo["user_timezone"]], ")")).')</div>'; $content .= '<div align="right"><img src="images/GEM/chars.png" alt="" title="" />='.$numSignup.'     <img src="images/GEM/coms.png" alt="" title="" />='.$numCom.'</div></td></tr>'; } else { $userStart = GEMdateBlk("D M j, Y", $row['gemStartTime'], $userinfo["user_dst"], $userinfo["user_timezone"]); $content .= '</table><table cellspacing="0" cellpadding="0" align="center" width="100%"><tr><td align="center"><br /><strong><u>'.$userStart.'</u></strong></td></tr>'; $content .= '<tr><td><a href="'.getlink("GEM&pg=5&eid=$id").'">'.$row['gemTitle'].'</a>'; $content .= '<div align="right">'.GEMdateBlk("g:i a", $timestamp, $userinfo["user_dst"], $userinfo["user_timezone"]).' '.substr($l10n_gmt_regions[$userinfo["user_timezone"]], strpos($l10n_gmt_regions[$userinfo["user_timezone"]], "("), strpos($l10n_gmt_regions[$userinfo["user_timezone"]], ")")).')</div>'; $content .= '<div align="right"><img src="images/GEM/chars.png" alt="" title="" />='.$numSignup.'     <img src="images/GEM/coms.png" alt="" title="" />='.$numCom.'</div></td></tr>'; } } $content .= '</table>'; } else { $content .= sprintf(_GEM_NO_UPC, $blkDaysOut); } $calDays = array(0); // Build an array of days with events for the monthly calendar $sqlEvents2 = $db->sql_query("SELECT * FROM ".$prefix."_GEM_events WHERE gemStartTime BETWEEN '".$curStamp."' AND '".$lastStamp."' ORDER BY gemStartTime ASC"); while ($row = $db->sql_fetchrow($sqlEvents2)) { $calDays[] = GEMdateBlk("j", $row['gemStartTime'], $userinfo["user_dst"], $userinfo["user_timezone"]); } // Spacer for calendar only $content .= '<br /><br />'; // Unix timestamps for first and last day of month based on user timezone-dst $firstUStamp = gmmktime(0, 0, 0, L10NTime::date("m", gmtime(), $userinfo["user_dst"], $userinfo["user_timezone"]), 1, L10NTime::date("Y", gmtime(), $userinfo["user_dst"], $userinfo["user_timezone"])); $lastUStamp = gmmktime(0, 0, -1, L10NTime::date("m", gmtime(), $userinfo["user_dst"], $userinfo["user_timezone"])+1, 1, L10NTime::date("Y", gmtime(), $userinfo["user_dst"], $userinfo["user_timezone"])); // Generate a calendar for users to easily see which days have events. // This section is purely based on user timezone settings (GMT default). // Generate calendar heading. $content .= '<table cellspacing="0" cellpadding="0" align="center" width="100%"> <tr> <th colspan="100%" align="center">'.GEMdateBlk2("F", $firstUStamp, $userinfo["user_dst"], $userinfo["user_timezone"]).'</th> </tr> <tr> <td align="center" width="15%" style="background-color: '.$bgcolor1.';"><strong>S</strong></td> <td align="center" width="14%" style="background-color: '.$bgcolor1.';"><strong>M</strong></td> <td align="center" width="14%" style="background-color: '.$bgcolor1.';"><strong>T</strong></td> <td align="center" width="14%" style="background-color: '.$bgcolor1.';"><strong>W</strong></td> <td align="center" width="14%" style="background-color: '.$bgcolor1.';"><strong>T</strong></td> <td align="center" width="14%" style="background-color: '.$bgcolor1.';"><strong>F</strong></td> <td align="center" width="15%" style="background-color: '.$bgcolor1.';"><strong>S</strong></td> </tr>'; // Get a numeric starting point for first weekday of month. $dayCounter = GEMdateBlk2("w", $firstUStamp, $userinfo["user_dst"], $userinfo["user_timezone"]); $endCounter = 6 - $dayCounter; // Get a tally of days in the current month. $numDaysInMonth = GEMdateBlk2("j", $lastUStamp, $userinfo["user_dst"], $userinfo["user_timezone"]); // Display blanks for previous month days carried over into new month's week. $content .= '<tr>'; for ($i = 0; $i < $dayCounter; $i++) { $content .= '<td align="center"> </td>'; } for ($i = 1; $i <= $numDaysInMonth; $i++) { if (in_array($i, $calDays)) { $content .= '<td align="center" style="background-color: '.$bgcolor2.';"><a href="'.getlink("GEM").'">'.$i.'</a></td>'; } else { $content .= '<td align="center">'.$i.'</td>'; } if ($dayCounter == 6) { $content .= '</tr><tr>'; $dayCounter = 0; } else { $dayCounter++; } } for ($i = 0; $i < $endCounter; $i++) { $content .= '<td align="center"> </td>'; } $content .= '</tr>'; // Close out the calendar table. $content .= '</table>'; /**********************************************************************************************/ /**********************************************************************************************/ /**********************************************************************************************/ // Modified Dragonfly CMS date function. function GEMdateBlk($format, $time, $region=0, $gmt=0) { // check if we already have a unix timestamp else convert if (!is_numeric($time)) { // 'YEAR-MONTH-DAY HOUR:MIN:SEC' aka MySQL DATETIME if (ereg('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $time, $datetime)) { $time = mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]); } } $time = L10NTime::tolocal($time, $region, $gmt); // If server time is DST but the given time isn't then DST is extracted if (date('I') == 1 && date('I', $time) == 0) $time += 3600; // return correct formatted time return gmdate($format, $time); } // Modified Dragonfly CMS date function. function GEMdateBlk2($format, $time, $region=0, $gmt=0) { // check if we already have a unix timestamp else convert if (!is_numeric($time)) { // 'YEAR-MONTH-DAY HOUR:MIN:SEC' aka MySQL DATETIME if (ereg('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $time, $datetime)) { $time = mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]); } } // If server time is DST but the given time isn't then DST is extracted if (date('I') == 1 && date('I', $time) == 0) $time += 3600; // return correct formatted time return gmdate($format, $time); } ?>

I've tried putting these together in a two column center block -but I lack the knowledge to do it successfully.

It seems like a simple enough task.

Can anyone help?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
?


Message to the forum moderator:

I would have deleted my original post if I could. I don't seem to have the permissions.

This isn't a Gammers module topic. Besides you cant even see "Gamers Modules & Blocks" as a listed forum when you click on the forum link. Look for yourself. It's hidden for some reason.

I'm trying to get some help combining 2 DF blocks into a two column center block. Has nothing to do with gaming. They could be 2 blocks about food recepies -and I'd expect to discuss the same thing: how to combine them.

So please delete my first post and un-bury my second one and put it out where it belongs? Please?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
?


I figured it out. Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
?

All times are UTC