68 Classifieds Forums  

Go Back   68 Classifieds Forums > v3.1.x Help & Support > v3.1 Questions & Support
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

v3.1 Questions & Support Help and support for 68 Classifieds v3.1.x

 
Thread Tools Display Modes
  #1  
Old 12-30-2007, 11:16 AM
nachtwerkmir nachtwerkmir is offline
Junior Member
 
Join Date: Dec 2007
Posts: 3
Default Adsense code in viewlisting.php

Hi, does anyone know how to correcty insert an google adsensecode in the viewlisting.php?

I would like to see the adsense code between the table with the ad and the table were the user can contact the seller.
Reply With Quote
  #2  
Old 12-30-2007, 07:08 PM
civ's Avatar
civ civ is offline
Senior Member
 
Join Date: Mar 2006
Location: Greer, SC
Posts: 532
Default

Add it wherever you want it in viewlisting.tpl.php
__________________
Civ's Modules:

� Stop Incomplete Listings! (proven revenue booster!)
� Scam Filter (Just say no to Nigerians!) updated
� Similar Listings (keep visitors longer)
� Feedback Mod (testimonial builder)
� Listing Status Reminder free!
� Google Checkout (PM if interested)
Reply With Quote
  #3  
Old 01-01-2008, 11:36 AM
nachtwerkmir nachtwerkmir is offline
Junior Member
 
Join Date: Dec 2007
Posts: 3
Default doesn't work

Well it doesn't seem to work. Is still get a parse error. I have tried it with and without the {/literal} tags. I would like to have the code just between the ad en the space where the user can contact the seller. This is the code with the parseerror.

<?php
/*
* 68 Classifieds
*
* All source code & content (c) Copyright 2006, 68 Classifieds
* unless specifically noted otherwise.
*
* @Author $Author: Blair $ (68 Classifieds)
* @copyright 68 Classifieds
* @link http://www.68classifieds.com
* @version 3.1
* @$Revision: 1.7 $
* @Updated: $Date: 2007/05/10 16:31:30 $
* @package 68 Classifieds
*
*/
require_once('includes/init.php');
require_once('includes/classes/kernel/Listings.php');
$Listing = new Listings( $db, $class_tpl );

$go=TRUE;
if (!empty($_GET['view']))
{
$view = (int)$_GET['view'];
if(!$Listing->getListing($view))
{
$go=FALSE;
}
else
{
$rs=$Listing->getListing($view);
}
}
else
{
$go=FALSE;
}
if($go==FALSE)
{
//no rows where found. Must be either expired or deleted. Lets show the not available page
//header("Location: search.php");
$class_tpl->assign('available', FALSE);
$class_tpl->assign('body','viewlisting/notavailable.tpl.php');
}
else
{
if($rs['display']=="Y")
{
$price=FormatCurrency($rs['price']);
}
else
{
$price=LANG_LISTING_PRICE_SOLD;
}
//assign variables
$modules->call_hook('view_listing', $view); // Call any module functions
$path=breadcrumb($rs['section'],0);
$class_tpl->assign('breadcrumb', $path);
$title= safeStripSlashes($title ." : ". $rs['title']);
$class_tpl->assign('available', TRUE);
$class_tpl->assign('title', $title);

//owner
$class_tpl->assign('ownerid', safeStripSlashes($rs['owner']));
$class_tpl->assign('ownername', safeStripSlashes($rs['username']));
$class_tpl->assign('owneraddress', safeStripSlashes($rs['address']));
$class_tpl->assign('ownercity', safeStripSlashes($rs['city']));
$class_tpl->assign('ownerstate', safeStripSlashes($rs['state']));
$class_tpl->assign('ownercountry', safeStripSlashes($rs['country']));
$class_tpl->assign('ownerzip', safeStripSlashes($rs['zip']));
$class_tpl->assign('ownerphone', $rs['phone']);

//listing
$class_tpl->assign('listingid', $rs['id']);
$class_tpl->assign('url', $rs['url']);
$class_tpl->assign('listingtitle', safeStripSlashes($rs['title']));
$class_tpl->assign('listingsection', $rs['section']);
$class_tpl->assign('listingprice', $price);
$class_tpl->assign('dateadded', $rs['dateadded']);
$class_tpl->assign('listingexpiration', $rs['expiration']);
$class_tpl->assign('listingviews', $rs['hitcount']);
$class_tpl->assign('shortdescription', nl2br(safeStripSlashes($rs['shortDescription'])));
$class_tpl->assign('description', nl2br(safeStripSlashes($rs['description'])));
$class_tpl->assign('display', $rs['display']);

//extra fields
$extra=array();
$sSQL = "SELECT f.fID,sValue FROM ".PREFIX."products_fields AS p, `".PREFIX."fields` AS f WHERE p.pID='".$view."' AND f.fSeen='Y' AND p.fID=f.fID ORDER BY f.fOrder ASC";
$result=$db->query($sSQL);
$i=0;
while ($rs=$result->fetch())
{
$sql="SELECT fID,fName,fType FROM `".PREFIX."fields` WHERE fID='".$rs['fID']."' AND fSeen='Y' ORDER BY fOrder ASC";
$result2=$db->query($sql);
$rs2=$result2->fetch();
if(strpos($rs['sValue'], "|"))
{
$rs['sValue'] = explode("|", $rs['sValue']);
}
if($rs2['fType']=="F")
{
$ext = substr(strrchr($rs['sValue'], "."), 1);
if($ext=="pdf")
{
$icon='<img src="images/icon_pdf.png" />';
}
elseif($ext=="zip")
{
$icon='<img src="images/icon_zip.png" />';
}
else
{
$icon='<img src="images/icon_page.png" />';
}
$rs['sValue']=$icon." <a href=\"uploads/".$rs['sValue']."\" target=\"_blank\">".$rs['sValue']."</a>";
}
$tmp = array(
'fID' => $rs['fID'],
'title' => $rs2['fName'],
'value'=> nl2br($rs['sValue']),
);
$extra[$i++] = $tmp;
$i++;
}
$class_tpl->assign('extra', $extra);

//get the images
$image=$Listing->getImages($view);
$class_tpl->assign('data', $image);

//get the display fields
$sSQL="SELECT lDisplay,lCols FROM ".PREFIX."listing_settings WHERE lID=1";
$result=$db->query($sSQL);
$rs=$result->fetch();
$lDisplay=$rs['lDisplay'];

$class_tpl->assign('canSaveFavorites', $canSaveFavorites);
$class_tpl->assign('viewphotos', $canViewPhotos);
$class_tpl->assign('viewseller', $canViewSeller);
$class_tpl->assign('viewaddress', $canViewAddress);
$class_tpl->assign('viewcity', $canViewCity);
$class_tpl->assign('viewstate', $canViewState);
$class_tpl->assign('viewcountry', $canViewCountry);
$class_tpl->assign('viewprice', $canViewPrice);
$class_tpl->assign('viewdate', $canViewDateAdded);
$class_tpl->assign('viewexpiration', $canViewExpiration);
$class_tpl->assign('viewhits', $canViewHits);
$class_tpl->assign('viewphone', $canViewPhone);
$class_tpl->assign('cols', $rs['lCols']);

$class_tpl->assign('allowcontact', $canContact);
$class_tpl->assign('allowfriendmail', $canEmailFriend);
$result->freeResult($result);
{literal}
<script type="text/javascript"><!--
google_ad_client = "pub-heredoiputmyid";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_page_url = document.location;
google_color_border = "FFFFDD";
google_color_bg = "FFFFDD";
google_color_link = "000000";
google_color_url = "FF6600";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
{/literal}
//catpcha?
$sSQL="SELECT rCaptcha FROM ".PREFIX."registration WHERE rID=1";
$result=$db->query($sSQL);
$rs=$result->fetch();
$rCaptcha=$rs['rCaptcha'];
$class_tpl->assign('rCaptcha', $rCaptcha);

if($lDisplay==1)
{
$class_tpl->assign('body','viewlisting.tpl.php');
}
else
{
$class_tpl->assign('body','viewlisting2.tpl.php');
}

//finally update the hit counter
$sSQL = "UPDATE ".PREFIX."products SET hitcount=hitcount+1 WHERE id=".$view;
$db->query($sSQL);
}

//now display the template
$class_tpl->display('layout.tpl.php', $view);
?>

Last edited by nachtwerkmir : 01-01-2008 at 11:39 AM.
Reply With Quote
  #4  
Old 01-01-2008, 12:46 PM
Lhotch's Avatar
Lhotch Lhotch is offline
Moderator
 
Join Date: Mar 2006
Posts: 2,017
Default

You need to place it in the template, not the script itself. You also need to surround the code with proper smarty escape tags.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #5  
Old 01-01-2008, 01:41 PM
civ's Avatar
civ civ is offline
Senior Member
 
Join Date: Mar 2006
Location: Greer, SC
Posts: 532
Default Template...

Quote:
Originally Posted by civ View Post
Add it wherever you want it in viewlisting.tpl.php
Yep, take another look at the bolded portion of my previous reply
__________________
Civ's Modules:

� Stop Incomplete Listings! (proven revenue booster!)
� Scam Filter (Just say no to Nigerians!) updated
� Similar Listings (keep visitors longer)
� Feedback Mod (testimonial builder)
� Listing Status Reminder free!
� Google Checkout (PM if interested)
Reply With Quote
  #6  
Old 01-01-2008, 01:54 PM
nachtwerkmir nachtwerkmir is offline
Junior Member
 
Join Date: Dec 2007
Posts: 3
Default smarty escape tags

Wrong file!! i see.
But what are the correct smarty escape tags? I am not familiar with the tags.
Reply With Quote
  #7  
Old 01-01-2008, 02:21 PM
Lhotch's Avatar
Lhotch Lhotch is offline
Moderator
 
Join Date: Mar 2006
Posts: 2,017
Default

http://www.smarty.net/manual/en/language.escaping.php
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embed YouTube code problems brw9532 v3.1 Questions & Support 4 09-29-2007 11:25 AM
Registration Code MADKing v3.1 Questions & Support 5 08-12-2007 04:35 AM
I need a little help please darek v3.1 Modifications 6 04-06-2007 10:28 AM
Adding Adsense. Baz v3.1 Questions & Support 10 12-13-2006 05:51 PM
Postal Code Search Mod GSP v3.1 Questions & Support 0 05-15-2006 04:52 PM


All times are GMT -4. The time now is 12:42 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.