Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
andyb2
Regular
Regular



Joined: Aug 26, 2012
Posts: 60

PostPosted: Sat Sep 22, 2012 3:33 am Reply with quote

Morning;

I've done some searches (possibly not successfully Rolling Eyes ) for answers to this, without going to "in depth" and not found anything. (I couldn't even find a link to the wiki from the homepage so had to search for that...)

Anyway, I've looked here: [ Only registered users can see links on this board! Get registered or login! ] and it doesn't tell me what I'm looking for....

I've got one banner placement set up on my theme, on the home page, near the top (under nuke nav, above the news module, etc.)

I'm after adding another, near the bottom, above the footer.
Or/ and- is it possible to add one mid point?- If I am showing 5 news stories on the home page, it will show after 3 of them, between the third and fourth?

Also, how can I get it to show a banner in between posts on the forum? (Or another alternative I've seen- not sure if possible on the phpbb version we use) is an "auto responder" that responds after so long/ to a post with x entries in it that purely contains an advertisement? (The user account was something like "advertisement")

Help appreciated- but it needs to be simple so anyone can do it, if possible. (I'm sure I'm not the only one who's required something like this)

Thanks.
 
View user's profile Send private message
andyb2







PostPosted: Sat Sep 22, 2012 3:42 am Reply with quote

I've just found this: [ Only registered users can see links on this board! Get registered or login! ]
Quote:
Want to have these google ads appearing in your forum?

Here's a howto:

OPEN
Code:
viewtopic.php



FIND
# Around line 840
Code:


//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//



FIND
Code:
   

for($i = 0; $i < $total_posts; $i++)
{   



REPLACE WITH
Code:
   

// Google AD
// Ramon Fincken, Websitefreelancers.nl Ramonfincken.com
$i_clone = 0;
for($i = 0; $i < $total_posts; $i++)
{
   $i_clone++;
   // Google AD
   // Ramon Fincken, Websitefreelancers.nl Ramonfincken.com   




FIND
Code:
   

      'L_MINI_POST_ALT' => $mini_post_alt,

      'U_MINI_POST' => $mini_post_url,
      'U_POST_ID' => $postrow[$i]['post_id'])
   );   




AFTER, ADD
Code:
   


   // Google AD
   // Ramon Fincken, Websitefreelancers.nl Ramonfincken.com
   if($i_clone === 1 || $i_clone === 7)
   {
      $row_color = ( !($i_clone % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($i_clone % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
         $i_clone++;

      $message = '<strong>Advertisement</strong>';
      $message .= '<script type="text/javascript"><!--
         google_ad_client = "pub-0964453741274626";
         google_ad_slot = "9315104464";
         google_ad_width = 468;
         google_ad_height = 60;
         //--></script>
         <script type="text/javascript"
         src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
         </script>';
      $template->assign_block_vars('postrow', array(
         'ROW_COLOR' => '#' . $row_color,
         'ROW_CLASS' => $row_class,
         'POSTER_NAME' => 'Google adsense',
         'POSTER_RANK' => 'Advertisement',
         'RANK_IMAGE' => $rank_image,
         'POSTER_JOINED' => '',
         'POSTER_POSTS' => '',
         'POSTER_FROM' => '',
         'POSTER_AVATAR' => '',
         'POST_DATE' => $post_date,
         'POST_SUBJECT' => $post_subject,
         'MESSAGE' => $message,
         'SIGNATURE' => '',
         'EDITED_MESSAGE' => '',
   
         'MINI_POST_IMG' => $mini_post_img,
         'PROFILE_IMG' => '',
         'PROFILE' => '',
         'SEARCH_IMG' => '',
         'SEARCH' => '',
         'PM_IMG' => '',
         'PM' => $pm,
         'EMAIL_IMG' => '',
         'EMAIL' => '',
         'WWW_IMG' => '',
         'WWW' => '',
         'ICQ_STATUS_IMG' => '',
         'ICQ_IMG' => '',
         'ICQ' => '',
         'AIM_IMG' => '',
         'AIM' => '',
         'MSN_IMG' => '',
         'MSN' => '',
         'YIM_IMG' => '',
         'YIM' => '',
         'EDIT_IMG' => '',
         'EDIT' => '',
         'QUOTE_IMG' => '',
         'QUOTE' => '',
         'IP_IMG' => '',
         'IP' => '',
         'DELETE_IMG' => '',
         'DELETE' => '',
   
         'L_MINI_POST_ALT' => $mini_post_alt,
   
         'U_MINI_POST' => $mini_post_url,
         'U_POST_ID' => $postrow[$i]['post_id'])
      );
   }
   // Google AD
   // Ramon Fincken, Websitefreelancers.nl Ramonfincken.com



DIY INSTRUCTIONS
Edit the
Code:
   

         google_ad_client = "pub-0964453741274626";
         google_ad_slot = "9315104464";


bit to fit your own google code, see the google page when creating a new ad


DIY INSTRUCTIONS
adjust the
Code:
   

if($i_clone === 1 || $i_clone === 7)


to fit your needs ( and times ) to show the google ad, right now it will show after the 1rst and the 7th post


Will this work within RN?
 
andyb2







PostPosted: Sat Sep 22, 2012 4:25 am Reply with quote

As an aside.... and because I don 't want people to do the same mistake I did (being dumb Rolling Eyes )

All I did to add another banner to the bottom of the home page;

1. create a new position in the advertising module- this gives you the position id (in my case, position 2)
2. Copied the block block-advertising.php and renamed it (block-advertising2)
3. Changed the code in the block to this:

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2006 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
    Header('Location: ../index.php');
    die();
}

// Position "1" by default is for block advertising. You can change this from your admin panel
$content = '<br />';
$content .= ads(2);
$content .= '<br />';

?>

The important bit is
Code:
$content .= ads(2);
^^ the (2) is the position.
4. Uploaded the new block via FTP
5. Activated the block in admin, with a position of centre down, altering the weight so it went above my recent forum posts block
6. Assigned a banner/ client to the block/ position....

I've done google adsense at the bottom. Why? Because it wasn't showing up everywhere- not sure if it was my implementation of the code from google, or not. I couldn't see the adverts @ work or on my work phone, but could on my own phone and PC's at home....
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sat Sep 22, 2012 9:33 am Reply with quote

For inter-mixing ads on the home news, you could use a static value to count how many stories have displayed within your theme function themeindex; then display them where desired. This example would post them after the 3rd and 6th article (if placed at the top of the function). Although you may need to adjust the html which wraps ads(3); to blend with your theme.

Code:
static $displayads;

if (isset($displayads)){
   $displayads++;
}else{
   $displayads=1;
}

if ($displayads==4 OR $displayads==7){
   echo '<div>';
   ads(3);
   echo '</div>';
}


Regarding adding between forum posts, I personally would just edit the viewtopic_body.tpl of my theme; rather than editing core forum files. Not sure what your template looks like but something like this at the top of "BEGIN postrow", pasting your adsense code directly and not using the advertising module for this one.
Code:
<!-- BEGIN postrow -->

<tr>
   <td>
   ad goes here
   </td>
</tr>


Using Google adsense, it follows each visitor around the site and loads ads based on the content of your page. If they page is not public it is not uncommon for the ads not to display; as if google can't see the page it doesn't know which ads to place. There is an option within adsense to provide google with authentication info so it can place ads in such areas, but I have never tried it.
 
View user's profile Send private message Visit poster's website
andyb2







PostPosted: Sat Sep 22, 2012 12:14 pm Reply with quote

The adsense thing- it was odd, as it was on the homepage and it was different IP addresses that couldn't see it... that said, I've done some tweaks on the adsense control panel on their website, and it appears to have fixed it (on my home page) when looking at it through works phone (not on wifi, so definitely a different IP address)

The code you edited didn't work with my theme- it put the advert over the top of the column with user info in, etc. and threw it all out of kilter....

Tried it at the bottom- it did the same, as well as putting the advert under each post in the thread (overkill)

I'll keep playing with the code, as I get time.... (I may try the other method linked above also)
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©