It is currently Thu Mar 28, 2024 10:21 am


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Adverts, But only for guests! : phpBB
PostPosted: Thu Apr 06, 2006 6:06 pm 
Moderator
Moderator

Joined: Thu Dec 15, 2005 2:59 pm
Posts: 681
Location: England
This is a simple MOD I wrote which will improve your site for registered users. It ads an advert in topics, but only viewable by guests (Making them register).

Its very easy to install, and will take under 1 minute..

Open: viewtopic.php

Find:
Code:
   $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
   $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];


Replace with:
Code:
   $row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
   $row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
   $num ++;


Find:
Code:
      'U_POST_ID' => $postrow[$i]['post_id'])
   );


After, Add:
Code:
      if($userdata['user_id'] == '-1')
   {
      $row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
      $num ++;

      $mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
      $template->assign_block_vars('postrow', array(
         'ROW_COLOR' => '#' . $row_color,
         'ROW_CLASS' => $row_class,
         'POST_DATE' => $post_date,
         'POST_SUBJECT' => 'Advertisement',
         'MINI_POST_IMG' => $mini_post_img,
         'POSTER_NAME' => 'Advertisement',
      'POSTER_RANK' => 'Advertiser',
         'MESSAGE' => '<div align="center">Ad code here</div>',
         'L_MINI_POST_ALT' => $mini_post_alt,
         'U_MINI_POST' => $mini_post_url,
         'U_POST_ID' => 'ad')
      );
   }


Save/Close all files.

Many registered members dont like adverts, as they often slow it down or get in the way. You will also get more members signing up this way.

_________________
Mountain biking forum ;)
Ponds and fishkeeping :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 06, 2006 8:12 pm 
Nice idea :)


Top
  
 
 Post subject:
PostPosted: Thu Apr 06, 2006 10:40 pm 
I have no life!
I have no life!

Joined: Sun Feb 13, 2005 6:12 pm
Posts: 1504
Location: My Office
Nice little script here Dale! :D

Now, here is my question - If the Advert is going to be a POST or something, where is it going to be? And how many times.

PS: You need to put more detail into the Description of the script. :D :wink:

_________________
Best Regards:
Aaron McGowan (aka: CyberGeek, =cipher=)

CyberGeek's Software Solutions
-- WWW: http://www.cybergeeksoftware.com
-- Tech Line: 1-519-860-4557
-- Email: cybergeek@cybergeeksoftware.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 2:42 pm 
Moderator
Moderator

Joined: Thu Dec 15, 2005 2:59 pm
Posts: 681
Location: England
It will be once, and it depends how to many posts are in the topic to where it goes. You can easily edit where and how many times its posted.

_________________
Mountain biking forum ;)
Ponds and fishkeeping :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 14, 2006 6:21 am 
I have no life!
I have no life!

Joined: Sun Feb 13, 2005 6:12 pm
Posts: 1504
Location: My Office
Greetings,

Well DALE - I am just playing with your code on a area51 board and I get the following error:

Code:
Parse error: parse error in /home/www/dev.xtremepc-solutions.com/viewtopic.php on line 1245

_________________
Best Regards:
Aaron McGowan (aka: CyberGeek, =cipher=)

CyberGeek's Software Solutions
-- WWW: http://www.cybergeeksoftware.com
-- Tech Line: 1-519-860-4557
-- Email: cybergeek@cybergeeksoftware.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 14, 2006 6:25 am 
I have no life!
I have no life!

Joined: Sun Feb 13, 2005 6:12 pm
Posts: 1504
Location: My Office
Well...

1. I fixed your error
2. It is a horrible adaption! (dont take this offensive!)

_________________
Best Regards:
Aaron McGowan (aka: CyberGeek, =cipher=)

CyberGeek's Software Solutions
-- WWW: http://www.cybergeeksoftware.com
-- Tech Line: 1-519-860-4557
-- Email: cybergeek@cybergeeksoftware.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 14, 2006 7:25 am 
Moderator
Moderator

Joined: Thu Dec 15, 2005 2:59 pm
Posts: 681
Location: England
Works fine for me, I even added a feature where admins can mass remove adverts for all users via paypal, and registered users can remove them via their profile. Once they are removed the link will vanish. ;)

_________________
Mountain biking forum ;)
Ponds and fishkeeping :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 8:27 pm 
I have no life!
I have no life!

Joined: Sun Feb 13, 2005 6:12 pm
Posts: 1504
Location: My Office
Greetings,

Dale, you should release that as a MOD if you have added the ACP functions like you have said in the post above. It would be great!

_________________
Best Regards:
Aaron McGowan (aka: CyberGeek, =cipher=)

CyberGeek's Software Solutions
-- WWW: http://www.cybergeeksoftware.com
-- Tech Line: 1-519-860-4557
-- Email: cybergeek@cybergeeksoftware.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 24, 2006 8:27 am 
Moderator
Moderator

Joined: Thu Dec 15, 2005 2:59 pm
Posts: 681
Location: England
Theres no point in using it unless you have a host, why would the admin want to pay to remove the adverts he added?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ]  Moderators: fhmagic, KJ, Moderators, Support Team

All times are UTC


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 post attachments in this forum

Search for:
Jump to:  
cron
100WebSpace © 2011