Okay this is a modification from code posted here based on Michael Pierce's main index hack which pulls Photopost on the main page. I have been using this for quite a while and made a multiple photo pal for my site which many people have requested so here you go.
and photopost.inc.php []$url_path = "http://www.couch-tomatoe.cc/photopost/data/3003/"; //URL of your photo album, where the index.pl is (with / at end) $data_dir = "http://www.couch-tomatoe.cc/photopost/data/3003/"; //URL of your photo dir where those jpeg stored (with / at end) [/]
and my query fails everytime.. I cannot find the gallery directoy which according to that mod has a index.pl now only thing I do find is the data directory which has the gifs under them...
Any clearer information as to what these should be set to would be helpfull..
$url_path = "http://www.couch-tomatoe.cc/photopost/data/3003/"; //URL of your photo album, where the index.pl is (with / at end)
It asks you here the directory to your scripts not your data directory. You should have this set to this
$url_path = "http://www.couch-tomatoe.cc/photopost/"; //URL of your photo album, where the index.pl is (with / at end)
Now as far as your query failing I would recheck your mysql access information. Did you edit the prefix variable right under the path to the include file in the pal box?
// // Featured Photos Code // Follow down to End Feature Photos Code //
$Globals['pp_db_prefix'] = "[:"red"]w3t_[/]";
// leave blank for no customization, otherwise list cats you only want images to appear from $forcats = "";
// which type of images do you want to show $q_switch = "random";
switch ($q_switch) { case "most_view": $query = "SELECT id,user,userid,cat,title,bigimage,views FROM {$Globals['pp_db_prefix']}photos WHERE bigimage!='' AND approved='1' $forcats ORDER BY views DESC LIMIT 5"; break; case "lastest": $query = "SELECT id,user,userid,cat,title,bigimage,views FROM {$Globals['pp_db_prefix']}photos WHERE bigimage!='' AND approved='1' $forcats ORDER BY date DESC LIMIT 5"; break; case "random": $query = "SELECT id,user,userid,cat,title,bigimage,views FROM {$Globals['pp_db_prefix']}photos WHERE bigimage!='' AND approved='1' $forcats ORDER BY RAND() DESC LIMIT 5"; break; }
// // Featured Photos Code // Follow down to End Feature Photos Code //
$Globals['pp_db_prefix'] = "w3t_"; <<<<THIS DOES NOT SEEM RIGHT
You would set this to whatever prefix your photopost install has if any. If your tables read settings photos etc etc without a prefix this is set to blank. This is not set to your forums prefix which you have it set to unless you made the prefix to photopost this.
and the last line as I stated in the instructions. On most hosts expecially when using the sidebar you need to fill in the database for threads here since you will get errors if you do not have this line in there. DATABASE is set to your forums database.
Cool thanx Got it to Work Just had to change that last DATABASE Line to the ubbthreads one and yeah I set the photopost to w3t_ to be similiar to threads Thanx for all your help I can style it from here like now I wanna take out that link so they can't click and get to the graphics page
Well don't know I have to look at it. It randomly pulls images. There is some code that can be added to restrict it to display only specific cats if you want.
Hey Chuck I get only the Pal table header saying "Featured Photos" but it doesn't pick up any photos.
My photopost.inc.php has: $url_path = "http://www.domain.com/threads/photopost/"; $data_dir = "http://www.domain.com/threads/photopost/data/";
...and my database name and user info below that.
My customboxpal has: require ("/home/myaccount/public_html/threads/photopost/photopost.inc.php");
...and my photopost prefix info ($pp_db_prefix = "jopho_";) plus my database name at the bottom (my photopost database and my threads database are the same)
I would double check your path and user information. This is the exact same thing I use on my site as long as your access info is correct all should be good.
[]AllenAyres said: worked well for me, thank you [/]
When did you install this? If you installed it prior to January 6th then that's the same code I had as well and I had no problems with it....it's only after the changes were made on the 6th with the code that I'm having troubles with.
In the instructions for photopost.inc.php where it reads:
[:"red"]//URL of your photo album, where the index.pl is (with / at end)[/]
Is this a misprint because I don't know where this file is. I am assuming, and that's usually where I go wrong, that it's to read index.php (inside the PhotoPost directory).
With this pal in place (I left the name of it as custombox3pal.php and overwrote the default file) on the left of the page layout...I get the same error in the center and right side of the page layout:
As I move this integrated pal into the middle of the page, the same error gets less. And as I move this pal into the right side of the page layout, the error is gone but I do get a little error note on the bottom left corner:
suggestion: rename the custompal3.php to custompalx.php to prevent me from overwriting someone's already in use custompal3
I had renamed it to custompal7 but accidently clicked on the old one after opening an ftp connection I don't have a backup either Users will still need to rename it to something else, but there won't be a custompal3 sitting on their harddrive to overwrite another one
It's odd...... on mine, I found I couldn't get this to work unless I commented-out the last line. When I put my forum database name in there, it stopped working. The only problem I've found is that the Max Online in the ShortStats Pal (which is below the PhotoPost Pal along with other Pal boxes) doesn't convert the Unix time into normal time. Or at least I think that's the only problem.
I also tried adding above the last line: mysql_connect ('localhost', 'name-of-my-database', 'password'); ...and that worked just the same as when the last line is commented-out.
How do I get this to have the same background color as the rest of the PAL boxes? The previous version of this pal box was that way. I'm not a big fan of the white background. http://www.laondalatina.com
find this bgcolor="#FFFFFF" and change to class="lighttable"
Now the select database command at the bottom will be required by about 99% of people out there otherwise you get error's
Now as far as your error Pasqualist I found that and there is always some sort of bizarre behavior when selected between databases I assume. While this does not wreak havoc with threads it does tend to play a little bit with IIP. Now given the fact that I love Photopost etc I just tweaked by loginpal.php file as bit. I can post it here if you like.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.