vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Mini Mods - New Ad Location - Below Postbit Signature (https://vborg.vbsupport.ru/showthread.php?t=209682)

TalkVirginia 03-27-2009 10:00 PM

New Ad Location - Below Postbit Signature
 
1 Attachment(s)
What it does?
Have you wanted to add a new Ad Location below the signature in each Postbit where you can place text ads or banner ads?

File Edits: 2
Template Edits: 2
New Templates: 1


*** This has only been tested with vBulletin 3.8.1. ***

Instructions

1. Make a backup of your Class_Postbit.php and your Showthread.php.

2. Open the Class_Postbit.php in your forum includes folder and look for:

PHP Code:

 
  
if ($post['isfirstshown'])
  {
   eval(
'$ad_location[\'ad_showthread_firstpost_start\'] = "' fetch_template('ad_showthread_firstpost_start') . '";');
   eval(
'$ad_location[\'ad_showthread_firstpost_sig\'] = "' fetch_template('ad_showthread_firstpost_sig') . '";');
  } 

(Note: The ending "}" should be on or around line 300.)

2. Add the following code below it:

PHP Code:

 
eval('$ad_location[\'ad_showthread_below_sig\'] = "' fetch_template('ad_showthread_below_sig') . '";'); 

3. Save the file.

4. Log into your AdminCP, and go to:
Styles & Templates => Styles Manager => Master Style => Add New Template

Product: vbulletin

Title: ad_showthread_below_sig

Template:

HTML Code:


<br />
<div align="center" class="smallfont">
This is a test ad below everyone's signature<br />
<a href="http://www.mydomain.com/register.php" target="_self">Sign Up Now To Remove These Ads</a>
</div>
 
 
 

Note: I had to add the new template to the Master Style in order to get it to show up under existing "Ad Locations Template" group.

5. Save your new template.


6. Now, make the following edit to your Postbit and Postbit Legacy templates:

Find:

Code:


            $template_hook[postbit_signature_end]

7. Add the following below:

Code:


            $ad_location[ad_showthread_below_sig]

8. Save template and do the same in Postbit_legacy.

9. Open showthread.php in the forum root folder and look for:
PHP Code:

 
// pre-cache templates used by all actions
$globaltemplates = array(
    
'ad_showthread_beforeqr',
    
'ad_showthread_firstpost',
    
'ad_showthread_firstpost_start',
    
'forumdisplay_loggedinuser',
    
'forumrules',
    
'im_aim',
    
'im_icq'

9. Insert "'ad_showthread_below_sig', in between
"'ad_showthread_firstpost_start'," and "'forumdisplay_loggedinuser',"

which should look like this when done:
PHP Code:

 
// pre-cache templates used by all actions
$globaltemplates = array(
    
'ad_showthread_beforeqr',
    
'ad_showthread_firstpost',
    
'ad_showthread_firstpost_start',
                
'ad_showthread_firstpost_sig',
                
'ad_showthread_below_sig',
    
'forumdisplay_loggedinuser',
    
'forumrules',
    
'im_aim',
    
'im_icq'

10. Save the file.

11. Upload your edited showthread.php to your forum's root folder, and
class_postbit.php file to your forum's includes folder overwriting the existing file.

Optional: If you use an ad rotation system such as OpenX, you may need to create a new plugin using the "postbit_display_start" hook for the ad to show up.

If you have questions, let me know and I'll try to help as much as I can.

Make sure you Click Install if you use this!!!

TalkVirginia 03-28-2009 07:30 AM

*** Reserved ***

ahmed-samara 03-28-2009 12:11 PM

*** Reserved ***

but nothing happen !

TalkVirginia 03-28-2009 01:45 PM

Quote:

Originally Posted by ahmed-samara (Post 1778902)
*** Reserved ***

but nothing happen !

What version of vBulletin do you have installed? Also, what type of ad did you put in the ad location?

masterweb 03-29-2009 02:09 PM

Same here...nothing happend (i'm unning a vB 3.8.1 board)

Quote:

Originally Posted by TalkVirginia (Post 1778944)
What version of vBulletin do you have installed? Also, what type of ad did you put in the ad location?


TalkVirginia 03-29-2009 02:40 PM

Quote:

Originally Posted by masterweb (Post 1779688)
Same here...nothing happend (i'm unning a vB 3.8.1 board)

Are you using the sample template content I posted in the hack or something else? if you put in some plain text it should show up. It didn't show up for me at first until the template was recached.

TalkVirginia 03-29-2009 02:58 PM

Ok.. I've been able to replicate the issue and will post a fix shortly.

Edit: I left out the step where you need to add the $ad_location[ad_showthread_below_sig] to the Postbit and Postbit Legacy templates.

1. Open your Admincp and go to :
Styles & Templates => Style Manager => Master Style => Edit Templates

2. Find the following hook location in your Postbit and Postbit Legacy templates:
Code:


    $template_hook[postbit_signature_end]

3. Add the following ad location below it:
Note: I did this with the thought that maybe you might want to do some calculation in the signature end hook to be included in your site signature. Just a thought. :)

Code:



    $ad_location[ad_showthread_below_sig]

4. Save your templates

Now it should show up. My apologies for missing this.

Jasem 03-29-2009 06:23 PM

good work, thank you!

Installed

TalkVirginia 03-29-2009 06:35 PM

Quote:

Originally Posted by Jasem (Post 1779877)
good work, thank you!

Installed

You're very welcome! :D

Brandon Sheley 03-29-2009 07:54 PM

It would be nice if it was default, but seems like a lot of work when you could just add the banner code in the postbit template, or openX


Keep up the good work :)


All times are GMT. The time now is 06:56 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.04901 seconds
  • Memory Usage 1,756KB
  • 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_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_php_printable
  • (4)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