Follow Us:
Tricked Out Mods: Forums

Best Hosting
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Old center blocks with 2.5
 
 
Post new topic   Reply to topic   print    Tricked Out News Forum Index -> RavenNuke
View previous topic :: View next topic  
Author Message
nextgen
I might as well work here
I might as well work here


Joined: Jun 28, 2009
Posts: 79
Location: Maryland

PostPosted: Fri Feb 03, 2012 6:06 pm 
Post subject: Old center blocks with 2.5
Reply with quote

Hey friend. What would make a center block kill both the right and left blocks but not throw any errors ? I have a custom news block that worked in 2.401 but in 2.5 the center blocks makes my left and right blocks disappear ?

Code:
<?php


//////////////////////////////////////////////////////////////////
// THERE SHOULD BE NO NEED TO EDIT BELOW THIS LINE
if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

if (eregi("block-Newsblock.php",$_SERVER['PHP_SELF'])) {Header("Location: index.php");
die();}
$limit     = 20;     // <= Total news items in block
$hnews     = 2;      // <= Maximum of highlighted news items in block
$showlinks = 1;      // Show more links at bottom
$strip     = "300";  // Size of the Max Number of characters displayed in highlighted news
$hnbdr     = 0;      // highlighted News Border off = 0 or border on = 1
$nnbdr     = 0;      // Normal News     Border off = 0 or border on = 1
$blbrd     = 0;      // border arround all items

//Dont change anything below!!
global $currentlang, $sitename, $ThemeSel;
{
$title       = "Latest";
$title1      = "News items";
$from        = "Posted by";
$moreLink    = "More news";
$topicLink   = "Subject";
$archiveLink = "News Archive";
$submitLink  = "Submit News";
$morenews    = "Read more";
$Printer     = "Print frindly";
$friend      = "Send to friend";
$LDcounter   = "times read";
}

function sa_darkColor($color, $level=16) {
$ret = strval($color);
if ($ret[0] == "#") {
$red = hexdec(substr($ret,1,2));
$grn = hexdec(substr($ret,3,2));
$blu = hexdec(substr($ret,5,2));
$red = (($red-$level) > 0) ? $red-$level : 0;
$grn = (($grn-$level) > 0) ? $grn-$level : 0;
$blu = (($blu-$level) > 0) ? $blu-$level : 0;
$ret = sprintf("#%02X%02X%02X", $red, $grn, $blu);
}
return $ret;
}

function sa_lightColor($color, $level=16) {
$ret = strval($color);
if ($ret[0] == "#") {
$red = hexdec(substr($ret,1,2));
$grn = hexdec(substr($ret,3,2));
$blu = hexdec(substr($ret,5,2));
$red = (($red+$level) < 255) ? $red+$level : 255;
$grn = (($grn+$level) < 255) ? $grn+$level : 255;
$blu = (($blu+$level) < 255) ? $blu+$level : 255;
$ret = sprintf("#%02X%02X%02X", $red, $grn, $blu);
}
return $ret;
}
global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5, $nukeurl, $db, $prefix, $admin, $topic, $topicname, $topicimage, $topictext, $informant, $multilingual, $currentlang;

$bgdark1  = sa_darkColor ($bgcolor5, 5);
$bgdark2  = sa_darkColor ($bgcolor5, 25);
$bgdark3  = sa_darkColor ($bgcolor5, 25);

$bglight1 = sa_lightColor($bgcolor5, 25);
$bglight2 = sa_lightColor($bgcolor5, 15);
$bglight3 = sa_lightColor($bgcolor5, 5);

if ($multilingual == 1) {$querylang = "AND (alanguage='$currentlang' OR alanguage='')";} else {$querylang = "";}
$content = "<div align=center><table cellspacing=\"2\" cellPadding=\"1\" width=\"100%\" border=\"$blbrd\" bordercolor=\"$bgdark2\" bgcolor=\"$bgcolor5\"><tr><td align=\"center\">";

$sql = "SELECT t1.title AS cat, t0.score, t0.sid, t0.catid, t0.alanguage, t0.informant, t0.title, t0.time, t0.hometext, t0.topic, t0.comments, t0.counter, t2.topicimage, t2.topicid, t2.topictext FROM ".$prefix."_stories t0, ".$prefix."_stories_cat t1, ".$prefix."_topics t2 WHERE t0.catid=t1.catid AND t0.topic=t2.topicid $querylang ORDER BY t0.sid DESC LIMIT 0, $limit";
$result = $db->sql_query($sql);
$rc = 0;
while ($row = $db->sql_fetchrow($result)) {
$score = $row[score];
$sid = intval($row['sid']);
$title  = $row[title];
$inform = $row[informant];
$langu  = $row[alanguage];
$text   = $row[hometext];
$D = substr($row[time], 8, 2);
$M = substr($row[time], 5, 2);
$Y = substr($row[time], 2, 2);
$time = $D."/".$M."/".$Y;
$linkstrip7 = stripslashes($text);
if(strlen($linkstrip7) > $strip) {
$linkstrip7 = substr($linkstrip7,0,$strip);
$linkstrip7 .= "...";}
$comtotal = $row[comments];
$counter = $row[counter];
if ($hnbdr==1) {$hncs = 1;} else {$hncs = 2;}
if ($nnbdr==1) {$nncs = 1;} else {$nncs = 1;}
if ($rc<$hnews) {
$ThemeSel = get_theme();
$pict     = "themes/$ThemeSel/images/topics/$row[topicimage]";
$size     = getimagesize($pict);
$width    = "$size[1]";
$content .= "<table cellspacing=\"$hncs\" align=\"center\" cellPadding=\"2\" width=\"100%\" border=\"$hnbdr\"><tr><td align=center valign=\"top\" width=\"".$width."\"><b><img src=\"$pict\" border=\"0\" Alt=\"$row[topictext]\"></b></td>";
$content .= "<td bgcolor=\"$bgcolor5\" valign=\"top\" title=\"$from $inform\" onMouseOver=this.style.backgroundColor=\"$bglight1\" onMouseOut=this.style.backgroundColor=\"$bgcolor5\" onclick=\"window.location.href='news.html?amp;file=article&amp;sid=$sid'\"><a href=\"news.html?amp;file=article&amp;sid=$sid\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b>$title</b></font></a><br>";
$content .= "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">$linkstrip7</font></td></tr></table>\n";
if ($hnews!=$limit) {$content .= "<table><tr><td height=\"3\"></td></tr></table>";}
} else {
$pict     = "images/topics/$row[topicid].gif";
$content .= "<table cellspacing=\"$nncs\" align=\"center\" cellPadding=\"2\" width=\"100%\" bgcolor=\"$bgcolor5\">";
$content .= "<tr><td bgcolor=\"$bgcolor5\" align=center width=\"20%\"><b>$row[topictext]</b></td>";
$content .= "<td bgcolor=\"$bgcolor5\" align=center width=\"15%\">$time</td><td bgcolor=\"$bgcolor5\" align=left valign=\"top\" width=\"50%\" title=\"$from $inform\" onMouseOver=this.style.backgroundColor=\"$bglight1\" onMouseOut=this.style.backgroundColor=\"$bgcolor5\" onclick=\"window.location.href='news.html2222&amp;file=article&amp;sid=$sid'\"><a href=\"news.html?amp;file=article&amp;sid=$sid\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b>$title</b></font></a></td><td bgcolor=\"$bgcolor5\" align=right width=\"15%\" title=\"$LDcounter\">Reads: $counter</td></tr></table>\n";
}
$rc = $rc+1;
}
$content .= "</td></tr><tr><td align=center>";
if ($hnews!=$limit) {
$sql1 = "SELECT topicid, topictext FROM ".$prefix."_topics order by topicid";
$result4 = $db->sql_query($sql1);
while( list($topicid, $topictext) = $db->sql_fetchrow( $result4 )){
}
}
$content .= "</td></tr>";
if ($showlinks==1){$content .= "<tr><td align=center>[&nbsp;<A HREF=\"topics.html\">News Topics</A>&nbsp;]&nbsp;[&nbsp;<A HREF=\"archive.html\">$archiveLink</A>&nbsp;]&nbsp;[&nbsp;<A HREF=\"submit.html\">$submitLink</A>&nbsp;]</td></tr>";}
$content .= "</table>";
?>


Any help would be just awesome.
  
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Palbin
Regular
Regular


Joined: May 23, 2009
Posts: 15


PostPosted: Sat Feb 04, 2012 12:11 pm 
Post subject:
Reply with quote

Do other blocks appear below this block? Is it a php error or potential display issue.
  
Back to top
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic   print    Tricked Out News Forum Index -> RavenNuke All times are GMT - 5 Hours
 
 Page 1 of 1
 
 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
Forums ©