Adding blocks in your footer

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Adding blocks in your footer
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
I was asked this on another site and am posting it here for whoever wants to use it.


Open the theme.php for the theme you wish to add the block into find the function themefooter after the global line you want to add the block or blocks in this example the global names may not be what you have in your theme now so just use this as referance if $db or $dbi isnt present in the global names then you will have to add it..

function themefooter() {
    global $index, $user, $banners, $cookie, $prefix, $dbi, $db, $total_time,
$start_time, $admin, $nukeurl, $foot1, $foot2, $foot3, $foot4;
<!--Start Block Addon By Telli-->
$maxshow = 30;   // Number of downloads to display in the block.
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by date DESC limit 0,$maxshow");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", "<b>$title</b>");
    $show .= "$a: <a href=\"modules.php?nam e=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">
$title2</a><br><b>$hits</b> times<br>";
        $showdownloads = " <A name= \"scrollingCodedownloads\"></A><MARQUEE behavior= \"scroll\" direction= \"up\" height=\"114\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover='this.stop()' onmouseout='this.start()'>
<table width=\"100%\"><tr><td>$show
</td></tr></table></marquee>";
   
   
    $a++;
}
<!-- End Block Addon-->

Then of course below is the rest of your function themefooter. Now to use them in your theme you will have to add a call for them in the themefooter of the theme and also if the footer is solid meaning it doesnt contain any tables or td cells your going to have to do some editing your going to want to create a table with 3 cells left right and center. Center you can use for your footer message and gen time or whatever you choose. then in the other cells where you decide you will add this to call the block function from your theme.php..

$showdownloads

Easy as pie!
If you require assistance with this please post.

Telli

UPDATED 8/27/2005 for new SQL Layer



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#2   
Purus
CZ Super Newbie
Purus has been a member for over 20 year's 20 Year Member
usa.gif newyork.gif
Occupation: Student
Gender: Male
Fav. Sports Team: US Junior Orienteering Team
Website:
Status: Offline
Joined: Dec 28, 2003
0.01 posts per day
Posts: 62
Points: 2,591
   
Wow, cool! I noticed you have two blocks at the bottom of the forums pages (5 Latest Members and Top 5 Posters). I imagine that is a completely different process right?

Do the blocks have to be modified into horizontal form to fit into the footer correctly?




_________________
[ Register or login to view links on this board.] | [ Register or login to view links on this board.]
Back to top Reply with quote
#3   Re: Adding blocks in your footer
sddarkman619
CZ Newbie
sddarkman619 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Jul 03, 2004
0.00 posts per day
Posts: 12
Points: 958
   


Originally posted by Telli @ Fri Jan 09, 2004 3:15 am:


Then of course below is the rest of your function themefooter. Now to use them in your theme you will have to add a "Call" for them in the footer of the theme and also if the footer is solid meaning it doesnt contain any tables or td cells your going to have to do some editing your going to want to create a table with 3 cells left right and center. Center you can use for your footer message and gen time or whatever you choose. then in the other cells where you decide you will add this to "Call" the block function from your theme.php..
$showdownloads

Easy as pie!
If you require assistance with this please post.

Telli


ok so I will put the "call" into the theme.php file in the theme I am using? and how do I know "how" the block is called?
where does it define "$showdownloads"
I want to put other blocks down there and I don't know how the site "calls" them, there names so to say?


EDIT:
ok I just saw the scroll, I didn't see the whole post....sorry.


Back to top Reply with quote
#4   re: Adding blocks in your footer
sddarkman619
CZ Newbie
sddarkman619 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Jul 03, 2004
0.00 posts per day
Posts: 12
Points: 958
   
I still can't get this to work. I get an error after I enter the code, it says undefined call in footer.php.
has anyone else been able to get this to work?



Back to top Reply with quote
#5   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Paste your theme function themefooter in here I will take a look.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#6   re: Adding blocks in your footer
sddarkman619
CZ Newbie
sddarkman619 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Jul 03, 2004
0.00 posts per day
Posts: 12
Points: 958
   
BTW the site is here: [ Register or login to view links on this board. ]

oh and where do you get the scrolling weblinks block?

ok here is my code in the theme.php file of my theme:

/* Footer Code - Also affects right side blocks, added $showdownloads */
300 function themefooter() {
301 global $index, $banners,$db,$dbi,$showdownloads;
302
303 /*---------start scrolling downloads code------*/
304 $maxshow = 10; // Number of downloads to display in the block.
305
306 if (eregi("block-ScrollDownloads.php",$_SERVER['PHP_SELF'])) {
307 Header("Location: index.php");
308 die();
309 }
310
311 global $prefix, $db;
312 $show = "";
313 $a = 1;
314 $result = $db->sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by hits DESC limit 0,$maxshow") ;
315 while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
316 $title2 = ereg_replace("_", " ", $title);
317 $show .= "$a: <a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">$titl e2</a><br> Downloaded $hits times<br><br>\n";
318 $a++;
319 }
320 $showdownloads = "<A name= \"scrollingCodeDownloads\"></A>\n";
321 $content .= "<MARQUEE behavior= \"scroll\" align=\"right\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover='this.stop()' onmouseout='this.start()'>\n";
322 $content .= "$show";
323 $content .= "</marquee>\n";
324 /*------end scrolling downloads code------------*/
325
326
327 if ($index == 1) {
328 echo "</td><td>| | </td><td valign=\"top\">";
329 blocks(right);
330 echo "</td>";
331 }
332
333 echo "</td></tr></table></td></tr></table>";
334 echo"<table border=\"0\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
335 <tr>
336 <td colspan=\"3\"><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
337 <tr>
338 <td height=\"25\" width=\"350\" background=\"themes/2_The_Xtreme/images/storyhead.gif\"><strong> ;;</stro ng></td>
339 <td height=\"25\" background=\"themes/2_The_Xtreme/images/storystrip.gif\"> ;;</td>
340 <td height=\"25\" width=\"5\" background=\"themes/2_The_Xtreme/images/storyend.gif\"> ;;</td>
341 </tr>
342 </table>
343 </td>
344 </tr>
345 <tr>
346 <td background=\"themes/2_The_Xtreme/images/storyback.gif\"> ;;</td>
347 <td bgcolor=\"000000\" background=\"themes/2_The_Xtreme/images/stars.gif\"><table border=\"0\" border=\"0\"
348 cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">
349 <tr>
350 <td>";
351
352 "<td>";
353 $showdownloads; /*<--------this is where I added the call*/
354 echo "</td>";
355
356
357 "<td>";
358 if ($banners) {
359 echo "<br>";
360 include("banners.php");
361 }
362
363 echo"<br>";
364 footmsg();
365
366 echo "<br>";
370 </tr>
371 </table>
372 </td>
373 <td width=\"5\" background=\"themes/2_The_Xtreme/images/storybackend.gif\"> ;;</td>
374 </tr>
375 <tr>
376 <td colspan=\"3\"><table border=\"0\" width=\"100%\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
377 <tr>
378 <td height=\"25\" width=\"5\" background=\"themes/2_The_Xtreme/images/storybackendfoot.gif\"> ;;</td>
379 <td height=\"25\" background=\"themes/2_The_Xtreme/images/storystripfoot.gif\"> ;;</td>
380 <td height=\"25\" width=\"350\" background=\"themes/2_The_Xtreme/images/storyfoot.gif\"> ;;</td>
381 </tr>



Back to top Reply with quote
#7   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Your using this theme now? Please post theme without the line #'s attach it actually in a zip file, the WHOLE theme.php.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   re: Adding blocks in your footer
sddarkman619
CZ Newbie
sddarkman619 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Jul 03, 2004
0.00 posts per day
Posts: 12
Points: 958
   
here is the theme pack its called 2 the extrme...



Attached Files
2txtheme-phpbb2.zip (236.73 KB, Downloaded: 5291 Time(s))


Back to top Reply with quote
#9   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Does the footer message span 100%?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#10   re: Adding blocks in your footer
sddarkman619
CZ Newbie
sddarkman619 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Jul 03, 2004
0.00 posts per day
Posts: 12
Points: 958
   
it looks like it does..... on my page it spans the bottom of the site. yes.
just so you know, I am using phpnuke 7.2 and I believe this theme was for 6.5+, maybe 7.0, 7.1....I have to worek with it to get it to work.....



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

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