 | |  | | | Classifieds Installation & Upgrades If you're having install or upgrade problems, post here. |
December 25th, 2004, 01:35 PM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Jan 2002 Location: Albany, Oregon
Posts: 207
| Ads on my vbPortal page?
Hi all,
Does anyone know if I can get ads to appear on a vbPortal page? I like the thumbincluder idea for Photopost and it appears to work great for me with Photopost. Is there something like this for Photopost-Classifieds?
-- Mike
|
| |
December 25th, 2004, 05:20 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,685
|
Make a php block of code to pull the ads
Base the code off the Photopost inc_features.php file as I would refrain from using thumbincluder it is so way outdated.
|
| |
December 27th, 2004, 12:22 AM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Jan 2002 Location: Albany, Oregon
Posts: 207
|
Omega, can you help a bit? Here's the inc_features.php I am using below. Should I tell it to require config-inc.php instead? Quote:
<?
//////////////////////////// COPYRIGHT NOTICE //////////////////////////////
// This script is part of PhotoPost PHP, a software application by //
// All Enthusiast, Inc. Use of any kind of part or all of this //
// script or modification of this script requires a license from All //
// Enthusiast, Inc. Use or modification of this script without a license //
// constitutes Software Piracy and will result in legal action from All //
// Enthusiast, Inc. All rights reserved. //
// http://www.photopost.com legal@photopost.com //
// Contributing Developer: Michael Pierce (mpdev.com) //
// //
// PhotoPost Copyright 2004, All Enthusiast, Inc. //
////////////////////////////////////////////////////////////////////////////
require "config-int.php";
// If you have placed PhotoPost into a seperate database, you will need to
// uncomment these lines to connect to the PhotoPost database. It is suggested
// that you install PP into the same database as vB for better performance.
//
// If you use the same userid/password to access both databases, you don't need to
// uncomment the mysql_connect - this is only if you require different ids to access
// the PhotoPost database.
//
//$link = mysql_connect ("localhost", "dbuserid", "dbuserpassword") or die('I cannot connect to the database.');
//mysql_select_db ("pp_database")or die("Could not select photopost database");
// Number of photos to display
$num_display = 7;
// Number of columns (1 for vertical)
$columns = 1;
// which type of images do you want to show (random, most_view, latest)
$q_switch = "random";
// == END CONFIGURATION ==
////////////////////////////////////////////////////////////////////////////
if ( !isset($ViewPerm) ) {
$mygroups = $bbuserinfo['usergroupid'];
if ( $bbuserinfo['membergroupids'] != "" ) $mygroups .= ",".$bbuserinfo['membergroupids'];
$grouparr = explode( ",", $mygroups );
$query = "SELECT id,ugnoview FROM {$pp_db_prefix}categories";
$resultb = mysql_query($query);
$ViewPerm = array();
while ( list( $catugid, $ugnoview ) = mysql_fetch_row($resultb) ) {
$noview=0; $ViewPerm[$catugid] = 1;
$allnoview = explode( ",", $ugnoview );
foreach ($allnoview as $key) {
if (in_array($key, $grouparr) ) {
$noview=1;
}
}
if ( $noview == 0 ) {
$ViewPerm[$catugid]=0;
}
}
mysql_free_result( $resultb );
}
function pp_get_ext( $filename ) {
return substr($filename, strrpos($filename,"."));
}
function pp_is_image( $filename ) {
$retval = 0;
$mediatypes = array( ".jpg", ".gif", ".png", ".bmp" );
$ext = pp_get_ext( $filename );
if ( in_array(strtolower($ext), $mediatypes) )
$retval = 1;
return( $retval );
}
//
// Featured Photos Code
// Follow down to End Feature Photos Code
//
switch ($q_switch) {
case "most_view":
$query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,c.catname,c.photos,c.posts
FROM {$pp_db_prefix}photos p
LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
WHERE c.cattype = 'c' AND p.cat != 500 AND p.storecat = 0
ORDER BY views DESC";
break;
case "lastest":
$query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,c.catname,c.photos,c.posts
FROM {$pp_db_prefix}photos p
LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
WHERE c.cattype = 'c' AND p.cat != 500 AND p.storecat = 0
ORDER BY date DESC";
break;
default:
$query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,c.catname,c.photos,c.posts
FROM {$pp_db_prefix}photos p
LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
WHERE c.cattype = 'c' AND p.cat != 500 AND p.storecat = 0
ORDER BY RAND()";
break;
}
$result = mysql_query($query);
$counted = 0; $countcol = 0; $featured = "";
while (list($pid,$puser,$puserid,$pcat,$photo,$catname,$cphotos,$cposts) = mysql_fetch_row($result)) {
if ( $ViewPerm[$pcat] == 1 ) continue;
if ( pp_is_image($photo) ) {
$photolen = strlen($photo);
$theext = pp_get_ext($photo);
$photo_name = str_replace( $theext, "", $photo );
$temp_user = $puserid;
$thumbtag = "{$full_path}$pcat/$puserid{$photo}";
$mthumb = "<img border=\"0\" src=\"{$data_dir}{$pcat}/$puserid{$photo_name}-thumb{$theext}\" alt=\"\" />";
// One box for each feature
$featured .= <<<PPPRINT
<td align="center" bgcolor="#FFFFFF" width="100%">
<table cellpadding="0" cellspacing="0" width="167">
<tr height="14"><td colspan="3"><img height="14" width="167" src="{$url_path}/images/photostackTop.gif" border="0"></td></tr>
<tr>
<td width="16"><img height="101" src="{$url_path}/images/photostackLeft.gif" width="16" border="0"></td>
<td width="135" bgcolor="#000000" align="center" valign="middle"><a href="{$url_path}/showphoto.php?photo=$pid">$mthumb</a></td>
<td width="16" align="right"><img height="101" src="{$url_path}/images/photostackRight.gif" width="16" border="0"></td>
</tr>
<tr height="14"><td colspan="3"><img height="14" width="167" src="{$url_path}/images/photostackBottom.gif" border="0" /></td></tr>
</table>
<font size="1" face="verdana,arial">by {$puser}<br /><a href="{$url_path}/showgallery.php?cat={$pcat}">$catname</a></font>
</td>
PPPRINT;
$counted++;
$countcol++;
}
// If we've reached our limit, quit
if ( $counted == $num_display ) break;
// If we need to end the column, do so.
if ( $countcol == $columns ) {
$featured .= <<<PPPRINT
</tr>
<tr>
PPPRINT;
$countcol = 0;
}
}
@mysql_free_result($result);
// Add on the ending tag
$featured .= "</tr>";
// First part is for the featured photos
// $photopostfeature not holds the Featured Photos box and $photopostcats (set below) holds the
// gallery list
$photopostfeature = <<<PPPRINT
<table class="tborder" cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="1" border="0" width="100%">
<thead>
<tr>
<td class="tcat" colspan="1" align="center">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('featurepal');"><img id="collapseimg_featurepal" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_featurepal].gif" alt="" border="0" /></a>
Featured Photos
</td>
</tr>
</thead>
<tbody id="collapseobj_featurepal" style="$vbcollapse[collapseobj_featurepal]">
$featured
</tbody>
</table>
</td>
</tr>
</table>
<br />
PPPRINT;
//
// End Featured Photos Code
//
// If you use PhotoPost in a seperate database from vB, you'll need to reselect the vB database!
//mysql_select_db ("vb_database");
?>
| |
| |
December 27th, 2004, 08:40 AM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,685
|
You should be able to do it like this Code: Content visible to verified customers only.
|
| |
January 8th, 2005, 02:31 PM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Jan 2002 Location: Albany, Oregon
Posts: 207
|
That didn't work. I'd like to put a small side block on my main vbPortal page showing the latest classified ads (no pictures). Anyone done this?
|
| |
February 12th, 2005, 10:49 PM
|
#6 (permalink)
| | Member Verified Customer
Join Date: Jul 2003
Posts: 93
|
anyone?
|
| |
February 13th, 2005, 10:00 AM
|
#7 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,685
|
Coding Modifications can be asked on Photopostdev.com
I posted over there a mod to show ads on the VB main index.
Basically the same goes true for VBPortal.
You might need to uncomment the link and select database lines to grab the info
Basically you need to make a php block with all the proper info.
|
| |
January 12th, 2007, 07:10 PM
|
#8 (permalink)
| | Member Verified Customer
Join Date: Jan 2002 Location: Albany, Oregon
Posts: 207
|
Hi Chuck, it looks like photopostdev.com is gone. Can you help us create one of these?
|
| |
January 12th, 2007, 07:23 PM
|
#9 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,685
|
This is a very old thread. The Classifieds has an inc_ads.php file like Photopost has where you can set up featured ads. http://www.photopost.com/forum/showp...32&postcount=1
You should be able to see the include needed but basically you create a php block in phpportals and echo the results. You should post in the mod forum on this type of thing.
Sorry but the very essense of my job work load dealing with support does not allow me free time to play with mods.
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 09:33 AM. | |