vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Different Ads on different forums + showing recent threads on main page of website (https://vborg.vbsupport.ru/showthread.php?t=55889)

Anat 08-04-2003 03:35 PM

Different Ads on different forums + showing recent threads on main page of website
 
Hi, I'm looking for a couple of hacks - I have tried searching these forums but couldn't find them.

1. I wish my forums to display different ads for different forums - like what is done at sitepoint. I don't know if this is done with a hack or just playing with different templates.

2. I also wish to display a dynamic box on the main page of my website (not the main page of the forums) with the 5 most recent threads in the forums. The main page is a PHP page.

Any help would be appreciated!!

Gary King 08-04-2003 04:30 PM

1. Modify the forumhome_forumbit_level1_nopost, and add a
PHP Code:

<td style="text-align: right;">$advertisement</td

and add some code to your index.php, like
PHP Code:

if ($forum['forumid']==1)
{
  
$advertisement="<img src=\"images/advertisement01.jpg\" />";


right before
PHP Code:

        eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";"); 

2. Have you tried searching? I've found https://vborg.vbsupport.ru/showthrea...t=%2Arecen%2A, and although it scrolls the threads, you could just remove the <marquee> tags.

Anat 08-05-2003 03:16 AM

Thank you so much! I will try out both and let you know how it worked. Much appreciated!

Anat 08-05-2003 07:11 AM

Well I'm having some problems implementing the marquee hack - posted about it in the thread. Looks like it's an old thread - I hope someone will be around to help. I guess I'm going to try the advertisements now :D

Anat 08-05-2003 08:06 AM

Gary - question about the PHP code for the different ads.

I need the images to be linked to the advertisers's website.

I'm not sure how to change the PHP code - would that be the right syntax -

if ($forum['forumid']==1)
{
$advertisement="<a href="http://adsite.com" target="_blank'><img src=\"images/advertisement01.jpg\" /></a>";
}

Not sure where I put the </a> at the end....

Gary King 08-05-2003 12:11 PM

Quote:

Today at 06:06 AM Anat said this in Post #5
Gary - question about the PHP code for the different ads.

I need the images to be linked to the advertisers's website.

I'm not sure how to change the PHP code - would that be the right syntax -


if ($forum['forumid']==1)
{
$advertisement="<a href="http://adsite.com" target="_blank'><img src=\"images/advertisement01.jpg\" /></a>";
}

Not sure where I put the </a> at the end....

This is what you should have:

PHP Code:

if ($forum['forumid']==1

  
$advertisement="<a href=\"http://adsite.com\" target=\"_blank\"><img src=\"images/advertisement01.jpg\" /></a>"



Anat 08-05-2003 12:58 PM

Phew - glad I asked. No way would I have guessed that!

Thanks again Gary!!!

Gary King 08-05-2003 01:46 PM

Glad I could help!

Anat 08-06-2003 05:47 PM

Hmmmm.... Gary for some reason this isn't working for me. I did everything you said - and no ad show up...

This is what the code at index.php looks like -


if ($forum['forumid']==1)
{
$advertisement="<img src=\"/forums/images_new/ad01.gif\" />";
}

if ($forum['forumid']==2)
{
$advertisement="<img src=\"/forums/images_new/ad01.gif\" />";
}

if ($forum['forumid']==3)
{
$advertisement="<img src=\"/forums/images_new/ad11.gif\" />";
}

if ($forum['forumid']==4)
{
$advertisement="<img src=\"/forums/images_new/ad11.gif\" />";
}

eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$te mpext")."\";");


---------------------------------------------------------------

I also changed the forumhome_forumbit_level1_nopost template exactly like you told me.

Nothing shows up - not even a red X (of course I have the images uploaded at that URL).

------------------------------------------------------------

In case you wish to see this for yourself you need to login as -

username - addelle password - review

As all of the above is only in my new design (I have changed the template in the new design only) and that user is set to see the new design (no posting or any other privelages ;))

Anat 08-06-2003 05:55 PM

BTW - not sure how this fits in but I would really like the ads to show right beneath the header of my site (i.e. right before the forums display). I tried putting the $advertisement as part of the header but it doesn't work...


All times are GMT. The time now is 01:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02087 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete