Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 12-07-2006, 12:21 PM
Casual Pligger
 
Join Date: Jun 2006
Location: Dover, NH
Posts: 62
Thanks: 3
Thanked 42 Times in 16 Posts
Quote:
Originally Posted by Dubai View Post
Where should I place the AdSense code (Step 6) within mollio-beat\link_summary.tpl if I want to show AdSense only when the full story is shown (not on the front page)?
You can place the Adsense code in step 6 anywhere you want in link_summary.tpl but if you only want it to display when a full story is shown, then wrap the code (in step 6) with this if statement:
Code:
{if $viewtype eq full}
    ...code from step 6 here...
{/if}
That way the adsense code is only displayed on full story pages.

Quote:
Originally Posted by Dubai View Post
Let me rephrase my question: Will this mod work if I place the AdSense Code (Step 6) in mollio-beat/story_center.tpl instead of placing it in mollio-beat/link_summary.tpl?
I just got done installing this mod for another Pligg user who had their Adsense in story_center.tpl and I wasn’t able to get it to work. Instead I ended up moving their Adsense code out of story_center.tpl and into link_summary.tpl and did something similar to what I suggested above where it's only displayed on full story pages.

Let me know if you have any problems with it.
__________________
Ryan 'Dravis' Knowles

RAGING DEBATE & PlugIM
Reply With Quote
  #22 (permalink)  
Old 12-08-2006, 04:39 PM
Casual Pligger
Pligg Version: 995
Pligg Template: Yget
 
Join Date: Sep 2006
Posts: 61
Thanks: 12
Thanked 3 Times in 3 Posts
Thanks a lot for your help, Dravis. Everything seems to work perfectly.
__________________
Pligg - a Swiss version of Pligg (very much online)
Reply With Quote
  #23 (permalink)  
Old 12-09-2006, 07:53 AM
Constant Pligger
 
Join Date: Nov 2006
Posts: 150
Thanks: 30
Thanked 15 Times in 11 Posts
Send a message via MSN to disier
I use to have it in top of the story_center.tpl but now I want to put it in the story but to show it when the full story is open.

where in the link_summary.tpl I should paste the code every time I paste it i get an error or put it up of the story and I want it in the botton of the story.

Here are some errors
Errores

Parse error: syntax error, unexpected T_ENDIF in /home/tanibol/public_html/noticias/class.template.php(674) : eval()'d code on line 174



Fatal error: TPL: [in blueshave/link_summary.tpl line 75]: syntax error: unidentified token 'full' (class.compiler.php, line 682) in /home/tanibol/public_html/noticias/class.template.php on line 898


Parse error: syntax error, unexpected $end in /home/tanibol/public_html/noticias/class.template.php(674) : eval()'d code on line 55

and here is what I put on the link_summary.tpl

Code:
{if $viewtype eq "full"}
{adsense assign=users_adsense}
{if $users_adsense}
	<script type="text/javascript"><!--
		google_ad_client = "{$google_adsense_id}";
		google_alternate_ad_url = "";
		google_ad_width = 468;
		google_ad_height = 60;
		google_ad_format = "468x60_as";
		google_ad_type = "text";
		google_ad_channel ="{$google_adsense_channel}";
		google_color_border = "f6f6f6";
		google_color_bg = "f6f6f6";
		google_color_link = "330066";
		google_color_text = "000000";
		google_color_url = "330066";
		//-->
	</script>
	<script type="text/javascript"
	  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	</script>
{else}				
	<script type="text/javascript"><!--
		google_ad_client = "MY ADSENSE PUB-ID";
		google_alternate_ad_url = "";
		google_ad_width = 468;
		google_ad_height = 60;
		google_ad_format = "468x60_as";
		google_ad_type = "text";
		google_ad_channel = "";
		google_color_border = "f6f6f6";
		google_color_bg = "f6f6f6";
		google_color_link = "330066";
		google_color_text = "000000";
		google_color_url = "330066";
		//-->
	</script>
	<script type="text/javascript"
	  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	</script>
{/if}{/if}
check my site http://noticias.tanibol.com and check a story http://noticias.tanibol.com/story.ph...EL-COMING-SOON

Last edited by disier; 12-09-2006 at 08:45 AM..
Reply With Quote
  #24 (permalink)  
Old 12-09-2006, 05:47 PM
Constant Pligger
 
Join Date: Nov 2006
Posts: 150
Thanks: 30
Thanked 15 Times in 11 Posts
Send a message via MSN to disier
I fix it by myself again here is the code the I use:
Code:
{if $viewtype eq "full"}
	{adsense assign=users_adsense}
	{if $users_adsense}
		<script type="text/javascript"><!--
			google_ad_client = "{$google_adsense_id}";
			google_alternate_ad_url = "";
			google_ad_width = 468;
			google_ad_height = 60;
			google_ad_format = "468x60_as";
			google_ad_type = "text";
			google_ad_channel ="{$google_adsense_channel}";
			google_color_border = "f6f6f6";
			google_color_bg = "f6f6f6";
			google_color_link = "330066";
			google_color_text = "000000";
			google_color_url = "330066";
			//-->
		</script>
		<script type="text/javascript"
		  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
		</script>
	{else}				
		<script type="text/javascript"><!--
			google_ad_client = "pub-1234567890987456";
			google_alternate_ad_url = "";
			google_ad_width = 468;
			google_ad_height = 60;
			google_ad_format = "468x60_as";
			google_ad_type = "text";
			google_ad_channel = "";
			google_color_border = "f6f6f6";
			google_color_bg = "f6f6f6";
			google_color_link = "330066";
			google_color_text = "000000";
			google_color_url = "330066";
			//-->
		</script>
		<script type="text/javascript"
		  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
		</script>
	{/if}
{/if}
Is the same I just separate a little this
Code:
{if $viewtype eq "full"}
	{adsense assign=users_adsense}
Reply With Quote
  #25 (permalink)  
Old 12-13-2006, 03:18 PM
New Pligger
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Going SICK

I haev tried now 6 times from scratch each time.
The page never loads there is something I'm doing wrong.
Please can u submit all the pages in a zip already modified.
Please it would help me and others in the future.

Thanks in advance if u find the time
Reply With Quote
  #26 (permalink)  
Old 12-14-2006, 01:28 PM
Casual Pligger
Pligg Version: 995
Pligg Template: Yget
 
Join Date: Sep 2006
Posts: 61
Thanks: 12
Thanked 3 Times in 3 Posts
I just realized that this mod can be very dangerous. I implemented the adsense code only once and that it shows only on the full story. Now if I go to my profile and click on "commented news" it shows all the full stories I commented on. As this stories are from different people, it shows adsense for the first three stories and with different adsense_ids.

Please pay attention yourself and who can, please help! How can I make sure that adsense is showing only once when I am looking at my commented stories or alternatively that adsense shows three times, but with the same adsense-id?
__________________
Pligg - a Swiss version of Pligg (very much online)
Reply With Quote
  #27 (permalink)  
Old 12-15-2006, 01:09 AM
Casual Pligger
 
Join Date: Jun 2006
Location: Dover, NH
Posts: 62
Thanks: 3
Thanked 42 Times in 16 Posts
Exclamation

Good catch Dubai, and since this is so important I feel the need to call attention to the following:

BUG FIX!

I updated the original post(s) to include this as part of the mod as well, but for all those who've already implemented this mod, I hope you see this post because this is an important fix.

Everyone who hired me to install this mod, I've already made the fix to your sites, so you're all good to go.

And for the rest of you... the fix:

user.php: search for $link->print_summary(); It's in 4 different places in the file: approximately lines 196, 211, 226, and 241. Replace all 4 of those lines with the following:
Code:
//***** PlugIM.com mod: Adsense Revenue Sharing
//$link->print_summary();			
$link->print_summary('summary');
//***** End PlugIM.com mod 
That should do it. It'll prevent Adsense ads from being displayed on stories listed under user profiles on the 'sent news', 'published news', 'unpublished news' or 'news commented on' pages.

For those of you who are coders, the problem was print_summary() has an optional parameter called $type and when nothing is passed in, $type defaults to 'full'. So in this case in the user.php file, there was no value being passed in to the print_summary() function calls so the full stories were being displayed rather than the summary.

My own personal opinion is that this is actually a bug in the Pligg code. I think even beyond the scope of the Adsense revenue sharing mod, this code change should be made to user.php.

Let me know if anyone has questions or problems. Again, if you want to save yourself the headache, PM me to ask about install rates. I could use a little extra Christmas money.
__________________
Ryan 'Dravis' Knowles

RAGING DEBATE & PlugIM

Last edited by Dravis; 12-15-2006 at 01:17 AM..
Reply With Quote
  #28 (permalink)  
Old 12-15-2006, 03:28 AM
Casual Pligger
Pligg Version: 995
Pligg Template: Yget
 
Join Date: Sep 2006
Posts: 61
Thanks: 12
Thanked 3 Times in 3 Posts
Thanks for the fix Dravis.
__________________
Pligg - a Swiss version of Pligg (very much online)
Reply With Quote
  #29 (permalink)  
Old 12-15-2006, 08:07 PM
New Pligger
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
can u make this mod where the googles dont appear on the index or unplublished pages.
I want the google to only work in the members topic when reviewed
Reply With Quote
  #30 (permalink)  
Old 03-08-2007, 07:29 AM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
I get an SQL error: Table 'newsdots_d60344181.users' doesn't exist

I get this when I try to change the percentage, I have a user that has a percentage of 0%, I am trying to make it 50%.

Any ideas.

Geoserv
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Adsense Revenue Sharing v0.1 problem? mapperkids General Help 2 08-17-2008 10:54 PM
EASY NO WORRIES PAINLESS adsense revenue sharing mod placement mod guide johntheentrepreneur Modification Tutorials 3 03-11-2008 01:47 PM
Google adsense revenue sharing, question dadaas Modification Tutorials 0 10-03-2007 01:13 PM
Google Adsense Revenue Sharing v0.1 error for 9.6 xbizsky Modification Tutorials 7 09-15-2007 06:35 AM
Adsense Revenue Sharing Placement Question??? onouchs General Help 8 03-26-2007 06:14 PM


Search Engine Friendly URLs by vBSEO 3.2.0