Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

how to place google ads between links

Quote Reply
how to place google ads between links
Is there a way to place some text link ads in between links?
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Yeah, there is a way, however I just don't have the code handy right now.

I recommend to do some search on the forum and you can be pretty sure to find a post from Andy that 'specifically' answers this question.

Hope this helps.

P.S.. if you still don't find the solution post again and tomorrow I will get the code and reply again.

Vishal

-------------------------------------------------------
Web Hosting Kit: A to Z of Web Hosting! http://www.webhostingkit.com/
Software Devil: Software Search Made Easy! http://www.softwaredevil.com/
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] how to place google ads between links In reply to
I did look prior to posting but did not find it. I tried a few different search terms. If anyone can recall the post please let me know.
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Hi,

Its pretty simple =)

You can do stuff like this:

Code:
<%if row_num == 5 or row_num == 10 or row_num == 15 or row_num == 20%>
...show your advert here
<%endif%>

Just put that in link.html.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] how to place google ads between links In reply to
Hi Andy,

I added the exact code as you have above (with my link code) in my link.html template. Build all. And the adds do not show. Any advice?

Also what is the difference between your newer recip check and the one I have installed? I have Recipcheck 1.7
Home Inspections
Best Real Estate Directory
Home Inspectors

Last edited by:

lostdog: Oct 29, 2009, 10:28 AM
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Try doing this.

1. First figure out between what number of links you want to display the ad.
2. Then change the code suggested by Andy, and update row_num as required.
3. Apply the code in link.html

You should be able to see the output on static or dynamic (you don't need to do build all to see this).

P.S.. if you have a site with many categories & links, than I recommend doing Build Staggered instead of build all.

Vishal

-------------------------------------------------------
Web Hosting Kit: A to Z of Web Hosting! http://www.webhostingkit.com/
Software Devil: Software Search Made Easy! http://www.softwaredevil.com/
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] how to place google ads between links In reply to
Here is what I have
<p>
<%if row_num == 5%>my goolge ads code
<%endif%>

</p>

Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Hi,

What happens if you put it in the <%loop% bit on category.html? For example:

Code:
<%loop links_loop%>
<%include link.html%>
<%if row_num == 5%>show advert code <%endif%>
<%endloop%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] how to place google ads between links In reply to
Hi Andy,

Not good. Got this on build changed:

GT::Template::Parser (32578): Deep recursion in includes, aborting include! at GT::Template::_compile_template line 611.
Please enable debugging in setup for more details.


Stack Trace======================================Links (32578): Links::environment called at /var/www/cgi-bin/links/admin/Links.pm line 786 with no arguments.Links (32578): Links::fatal called at GT::Base::error line 383 with arguments (GT::Template::Parser (32578): Deep recursion in includes, aborting include! at GT::Template::_compile_template line 611. ).Links (32578): GT::Base::error called at GT::Base::fatal line 295 with arguments (GT::Template::Parser=HASH(0x8846f84), DEEPINC, FATAL).Links (32578): GT::Base::fatal called at /var/www/cgi-bin/links/admin/GT/Template/Parser.pm line 574 with arguments (GT::Template::Parser=HASH(0x8846f84), DEEPINC).Links (32578): GT::Template::Parser::_parse_tags called at /var/www/cgi-bin/links/admin/GT/Template/Parser.pm line 172 with arguments (GT::Template::Parser=HASH(0x8846f84), SCALAR(0x80f203c), ARRAY(0x884d1f4)).Links (32578): GT::Template::Parser::_parse called at /var/www/cgi-bin/links/admin/GT/Template/Parser.pm line 122 with arguments (GT::Template::Parser=HASH(0x8846f84), new.html, HASH(0x884a82c), SCALAR(0x80f203c), ARRAY(0x884d1f4)).Links (32578): GT::Template::Parser::parse called at GT::Template::_compile_template line 611 with arguments (GT::Template::Parser=HASH(0x8846f84), new.html, HASH(0x884a82c), [undef]).Links (32578): GT::Template::_compile_template called at /var/www/cgi-bin/links/admin/GT/Template.pm line 387 with arguments (GT::Template=HASH(0x87efbf8), new.html, /var/www/cgi-bin/links/admin/templates/2007/compiled/new.html.compiled, [undef]).Links (32578): GT::Template::load_template called at /var/www/cgi-bin/links/admin/GT/Template.pm line 153 with arguments (GT::Template=HASH(0x87efbf8), new.html, [undef]).Links (32578): GT::Template::parse called at /var/www/cgi-bin/links/admin/Links.pm line 480 with arguments (GT::Template, new.html, ARRAY(0x87efba4), HASH(0x87ea65c)).Links (32578): Links::user_page called at /var/www/cgi-bin/links/admin/Links/SiteHTML.pm line 308 with arguments (new.html, HASH(0x87904ac), HASH(0x87ea65c)).Links (32578): Links::SiteHTML::__ANON__ called at /var/www/cgi-bin/links/admin/GT/Plugins.pm line 133 with arguments (HASH(0x87904ac), [undef]).Links (32578): GT::Plugins::dispatch called at /var/www/cgi-bin/links/admin/Links/SiteHTML.pm line 27 with arguments (GT::Plugins=HASH(0x8344494), site_html_new, CODE(0x87d39ec), HASH(0x87904ac), [undef]).Links (32578): Links::SiteHTML::display called at Links::Build::build_new_index line 226 with arguments (new, HASH(0x87904ac)).Links (32578): Links::Build::build_new_index called at /var/www/cgi-bin/links/admin/GT/Plugins.pm line 133 with arguments (HASH(0x879dbc8)).Links (32578): GT::Plugins::dispatch called at /var/www/cgi-bin/links/admin/Links/Build.pm line 30 with arguments (GT::Plugins=HASH(0x8344494), build_new_index, CODE(0x878d200), HASH(0x879dbc8)).Links (32578): Links::Build::build called at /var/www/cgi-bin/links/admin/nph-build.cgi line 373 with arguments (cool_flags, home, new_index, HASH(0x879dbc8)).Links (32578): main::_build_new called at /var/www/cgi-bin/links/admin/GT/Plugins.pm line 133 with arguments (HASH(0x833f668)).Links (32578): GT::Plugins::dispatch called at /var/www/cgi-bin/links/admin/nph-build.cgi line 138 with arguments (GT::Plugins=HASH(0x8344494), create_new, CODE(0x830565c), HASH(0x833f668)).Links (32578): main::build_changed called at /var/www/cgi-bin/links/admin/nph-build.cgi line 58 with no arguments.Links (32578): main::main called at /var/www/cgi-bin/links/admin/nph-build.cgi line 42 with no arguments.System Information======================================Current user: bestrealestatedirectory (2157)Perl version: 5.6.0Gossamer Links version: 3.3.0GT::SQL version: 1.112GT::Template version: 2.170DBI.pm version: 1.13Running under mod_perl: NoRunning under SpeedyCGI: No@INC = /var/www/cgi-bin/links/admin /usr/local/perl/lib/5.6.0/i686-linux /usr/local/perl/lib/5.6.0 /usr/local/perl/lib/site_perl/5.6.0/i686-linux /usr/local/perl/lib/site_perl/5.6.0 /usr/local/perl/lib/site_perl .CGI Input======================================do => changedEnvironment======================================AUTH_TYPE => BasicDOCUMENT_ROOT => /var/www/htmlGATEWAY_INTERFACE => CGI/1.1GT_TMPDIR => /var/www/cgi-bin/links/admin/tmpHTTP_ACCEPT => image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*HTTP_ACCEPT_ENCODING => gzip, deflateHTTP_ACCEPT_LANGUAGE => en-usHTTP_CONNECTION => Keep-AliveHTTP_HOST => www.bestrealestatedirectory.comHTTP_REFERER => http://www.bestrealestatedirectory.com/cgi-bin/links/admin/admin.cgi?page=build_nav.htmlHTTP_USER_AGENT => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)LD_PRELOAD => PATH => /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/binQUERY_STRING => do=changedREMOTE_ADDR => 70.11.234.90REMOTE_PORT => 2529REMOTE_USER => cwinspectREQUEST_METHOD => GETREQUEST_URI => /cgi-bin/links/admin/nph-build.cgi?do=changedSCRIPT_FILENAME => /var/www/cgi-bin/links/admin/nph-build.cgiSCRIPT_NAME => /cgi-bin/links/admin/nph-build.cgiSERVER_ADDR => 206.130.113.215SERVER_ADMIN => Postmaster@bestrealestatedirectory.comSERVER_NAME => www.bestrealestatedirectory.comSERVER_PORT => 80SERVER_PROTOCOL => HTTP/1.1SERVER_SIGNATURE => <address>Apache/2.0.52 (Red Hat) Server at www.bestrealestatedirectory.com Port 80</address>SERVER_SOFTWARE => Apache/2.0.52 (Red Hat)SPHERA_config => xSPHERA_monitor => xxxxSPHERA_pIOr => xSPHERA_pIOw => xSPHERA_pNETr => xSPHERA_pNETw => xSPHERA_service => xxxx
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Put this in link.html and it should work. (atleast it is working for me)


<%if row_num == 1%>
Custom Code here
<%else%>
Generic info for all other links.
<%endif%>

Vishal

-------------------------------------------------------
Web Hosting Kit: A to Z of Web Hosting! http://www.webhostingkit.com/
Software Devil: Software Search Made Easy! http://www.softwaredevil.com/
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] how to place google ads between links In reply to
What is Generic info for all other links?
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Here is link.html code. Is this correct? I dont see any ads and when I check page source I dont sdee the ad code.

<div id=
"l<%ID%>" class="linklisting">
<h4 class=
"linktitle">
<%if row_num == 1%>
<script type="text/javascript"><!--
google_ad_client
= "pub-2922332367725423";
/* 468x15, created 10/29/09 */
google_ad_slot
= "9534542786";
google_ad_width
= 468;
google_ad_height
= 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>
<%else%>
<%if detailed_url and isValidated eq 'Yes'%>
<a href="<%detailed_url%>"><%elsif URL ne 'http://' and isValidated eq 'Yes'%><a href="<%URL%>"><%endif%><%if highlight%><%Links::Tools::highlight($Title, $query)%><%else%><%Title%><%endif%><%if isValidated eq 'Yes'%><%if detailed_url or URL ne 'http://'%></a><%endif%><%endif%>
<%if isNew%><%Plugins::ULTRAGlobals::New_Image($Add_Date,$isNew)%><%endif%>
<%if isChanged%><span class=
"updated-item"><span>updated</span></span><%endif%>
<%if isPopular%><span class=
"popular-item"><span>popular</span></span><%endif%>
<%~if paymentsEnabled%>
<%if isUnpaid%><span class=
"unpaid-item"><span>unpaid</span></span><%endif%>
<%if isExpired%><span class=
"expired-item"><span>expired</span></span><%endif%>
<%if isFree%><span class=
"free-item"><span>free</span></span><%endif%>
<%~endif%>
<%endif%>
</h4>
<%if URL ne 'http://'%><p class=
"linkurl"><%if isValidated eq 'Yes'%><a href="<%URL%>"><%endif%><%if highlight%><%set equery = escape_html $query%><%set eURL = escape_html $URL%><%Links::Tools::highlight($eURL, $equery)%><%else%><%escape_html URL%><%endif%><%if isValidated eq 'Yes'%></a><%endif%></p><%endif%>

<p class=
"linkrating">
<%~if Votes%>
<%~set intRating = $Rating i/ 1%>
<img src="<%Links::Utils::image_url("stars-10-${intRating}.gif")%>" alt="<%intRating%> out of 10 stars" title="<%intRating%> out of 10 stars" /> (<%Votes%> vote<%if Votes != 1%>s<%endif%>)
<%~endif%>
<%~if paymentsEnabled and ExpiryDateFormatted and wasPaid%>
<%if isNotify or isExpired%><span class=
"linkexpired"><%endif%><%if isExpired%>Expired on:<%else%>Expiry date:<%endif%> <%ExpiryDateFormatted%><%if isNotify or isExpired%></span><%endif%>
<%~endif%>
</p>

<%if Description%><div class=
"linkdescription"><%if highlight%><%Links::Tools::highlight($Description, $query)%><%else%><%Description%><%endif%></div><%endif%>

<p class=
"linkactions">
<%~if isValidated eq Yes%>
<%if Review_Count%>
<a href="<%config.db_cgi_url%>/review.cgi?ID=<%ID%>">Read <%Review_Count%> Review<%if Review_Count != 1%>s<%endif%></a><%endif%>
<a href="<%config.db_cgi_url%>/review.cgi?ID=<%ID%>;add_review=1">Review It</a>
<a href="<%config.db_cgi_url%>/rate.cgi?ID=<%ID%>">Rate It</a>
<%if config.bookmark_enabled%>
<a href="<%config.db_cgi_url%>/bookmark.cgi?action=link_add;ID=<%ID%>">Bookmark It</a><%endif%>
<%if not isExpired and not isUnpaid%>
<%if isLinkOwner or not config.user_required%>
<a href="<%config.db_cgi_url%>/modify.cgi?LinkID=<%ID%>">Edit this link</a><%endif%>
<%endif%>
<%~endif%>
<%if paymentsEnabled%>
<a href="<%config.db_cgi_url%>/modify.cgi?do=payment_linked;process_payment=1;modify=1;ID=<%ID%>"><%if not wasPaid%>New Payment<%else%>Renewal Payment<%endif%></a><%endif%>
</p>
</div>

Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
What page/link are you checking to see the ads on.. post it here.

Vishal

-------------------------------------------------------
Web Hosting Kit: A to Z of Web Hosting! http://www.webhostingkit.com/
Software Devil: Software Search Made Easy! http://www.softwaredevil.com/
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] how to place google ads between links In reply to
We should be able to check any page with one link but here is one: http://www.bestrealestatedirectory.com/...alifornia/index.html
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Finish "Build Staggered" process from:

Admin -> Build ->

Vishal

-------------------------------------------------------
Web Hosting Kit: A to Z of Web Hosting! http://www.webhostingkit.com/
Software Devil: Software Search Made Easy! http://www.softwaredevil.com/
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] how to place google ads between links In reply to
I have done the staggered build:(
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
One reason why that code won't work is if you're using the 'links' variable in your category template instead of the newer links_loop variable.

Adrian
Quote Reply
Re: [brewt] how to place google ads between links In reply to
Adrian ,

Thanks for taking the time to reply. How to I fix this?
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Depends on if that's what's causing your problem. Are you using the older style links variable in your category.html template or are you using links_loop?

Adrian
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
I think what would be easier - is for you to either post your whole category.html template, or the bit where the links are shown (so we can see how your doing it)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] how to place google ads between links In reply to
Here is my catagory.html template. My lik.html is posted in this thread earlier. Thanks

<%set isCategory = 1%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/...TD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title><%site_title%>: <%Full_Name%></title>
<%if meta_name%>
<meta name="description" content="<%meta_name%>">
<%endif%>
<%if meta_keywords%>
<meta name="keywords" content="<%meta_keywords%>">
<%endif%>
<link rel="stylesheet" type="text/css" href="<%config.build_static_url%>/css/style.css" />
</head>
<%include include_header.html%>
<!-- Subcategories-->
<%if category%>
<h2>Categories:</h2>
<%category%>
<%endif%>
<!-- Links in this category. -->
<%if links%>
<%if next_span%>
<!-- Next/Previous links if spanning pages. -->
&nbsp; <small>Pages: <%next_span%></small>
<%endif%>
<%links%>
<%if next_span%>
<!-- Next/Previous links if spanning pages. -->
&nbsp; <small>Pages: <%next_span%></small>
<%endif%>
<%else%>
<p>There are no listings here. <a href="<%config.db_cgi_url%>/add.cgi?ID=<%category_id%>">Click here to add yours!</a></p>
<%endif%>

<!-- Related Categories -->
<%if related%>
<h2>RELATED CATEGORIES:</h2>
<ul><%related%></ul>
<%endif%>

<%include include_footer.html%>
Home Inspections
Best Real Estate Directory
Home Inspectors
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
What template set did you use to the basics from??? I would recommend to get the latest Luna template and cross check tags from there.

Shouldn't there be tag like <%include link.html%> ??? somewhere in there where you want to display links?

Try changing:

---------------
<%if links%> with <%if links_loop.length~%>
---------------
<%links%> with
<%loop links_loop~%>
<%include link.html%>
.........
---------------

Still I think it would be a good idea to download luna template for your reference, as it can save lot of time and wait.

Vishal

-------------------------------------------------------
Web Hosting Kit: A to Z of Web Hosting! http://www.webhostingkit.com/
Software Devil: Software Search Made Easy! http://www.softwaredevil.com/
-------------------------------------------------------
Quote Reply
Re: [lostdog] how to place google ads between links In reply to
Hi,

Instead of just:

Code:
<%links%>

Try using:

Code:
<%loop links_loop%>
<%include link.html%>
<%endloop%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates