View Single Post
  #69  
Old 09-24-2006, 01:05 AM
LICryptkeeper LICryptkeeper is offline
 
Join Date: Jun 2003
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

by breaks, I mean nothing shows up.

I did manage to start playing with some connection settings, and now I get "cannot connect" but I know the paths are correct. I'm not sure if it's a VB issue, version isue, or PP issue.

edit: Now I get "failed to select PhotoPost Database" I changed it from 192.168.1.1(which is the pp database) to localhost, do i need to edit anythign else?

I unccomented out the 2 lines in the mysql connection, and the last line. inside confic_inc.php the database user is $mysql_user and in the plugin it's $dbuserid,

is that correct?
vb3.6.1
pp 5.21

edit 2: moved the gallery into the forum directory, still no go.

Code:
$ppath="/home/******/public_html/forums/m_gallery";
require "{$ppath}/config-int.php";
//###################################################################################
//if you use Photopost in a SEPERATED database from vbulletin uncomment these lines
//###################################################################################
$link=mysql_connect("localhost","$dbuserid","$dbuserpassword") OR die("I cannot connected to the Database");
mysql_select_db("products") OR die("failed to select PhotoPost Database");
//####################################################################################

//##############################
// Number of photos to display
$num_display = 4;
//##############################

//#####################################
// Number of columns (1 for vertical)
$columns = 4;
//#####################################

//#####################################################################
// which type of images do you want to show (random, most_view, latest)
$q_switch = "random";
//######################################################################
if(!isset($ViewPerm))
{
	if(isset($vbulletin->userinfo['usergroupid']))
	{
		 $mygroups = $vbulletin->userinfo['usergroupid'];
		 if ($vbulletin->userinfo['membergroupids'] != "") $mygroups .= ",".$vbulletin->userinfo['membergroupids'];
	}
	 $grouparr = explode( ",", $mygroups );
	 $resultb = mysql_query("SELECT id,ugnoview FROM {$pp_db_prefix}categories");
	 $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;
		}
	}
}
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;
}
switch ($q_switch)
{
	case "latest":
        $query = "SELECT id,user,userid,cat,bigimage,height,width
                        FROM {$pp_db_prefix}photos
                        WHERE storecat = 0 AND userid = $userinfo[userid]
                        ORDER BY date DESC";
		break;
	case "most_view":
        $query = "SELECT id,user,userid,cat,bigimage,height,width
                        FROM {$pp_db_prefix}photos
                        WHERE storecat = 0 AND userid = $userinfo[userid]
                        ORDER BY views DESC";
		break;
	case "random":
        $query = "SELECT id,user,userid,cat,bigimage,height,width
                        FROM {$pp_db_prefix}photos
                        WHERE storecat = 0 AND userid = $userinfo[userid]
                        ORDER BY RAND()";
		break;
}
$result=mysql_query($query);
$counted = 0; $countcol = 0; $profileimagebits = "";
while (list($pid,$puser,$puserid,$pcat,$photo,$height,$width) = mysql_fetch_row($result))
{
	if ( $ViewPerm[$pcat] == 1 ) continue;
	if (pp_is_image($photo))
	{
		 $temp_user = $puserid;
		 if ($height > $width)
			  $mthumb = "<img src=\"{$url_path}/images/overlay-roundp.gif\" height=\"105\" width=\"81\" border=\"0\" alt=\"\" />";
		 else
			 $mthumb = "<img src=\"{$url_path}/images/overlay-round.gif\" height=\"81\" width=\"105\" border=\"0\" alt=\"\" />";
		 $profileimagebits .= <<<PPPRINT
    <td align="center" class="alt1">
        <table cellpadding="0" cellspacing="0" border="0">
         <tr>
          <td style="background: url({$data_dir}{$pcat}/thumbs/$photo); background-color: #000000; background-repeat: no-repeat; background-position: center;"><a href="{$url_path}/showphoto.php?photo={$pid}">$mthumb</a></td>
         </tr>
        </table>
    </td>
PPPRINT;
        $counted++;
        $countcol++;
	}
	if ($counted == $num_display ) break;
	if ($countcol == $columns)
	{
		$profileimagebits .= <<<PPPRINT
    </tr>
    <tr>
PPPRINT;
    $countcol = 0;
	}
}
@mysql_free_result($result);

//###################################################################################################################
//if you use PhotoPost in a SEPERATED database you need to uncomment this line to reselect it
//###################################################################################################################
//mysql_select_db("products") or die("Unable to select PhotoPost Database");
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01491 seconds
  • Memory Usage 1,799KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete