View Full Version : Photopost "gallery" clickable icon in postbit(_legacy) and/or profiles.
mini2
04-01-2006, 10:00 PM
Gone
Doha Services
04-02-2006, 10:35 AM
Nice :)
bada_bing
04-04-2006, 02:56 AM
Will test tomorrow
b6gm6n
04-05-2006, 01:58 AM
cheers, lovely mod
-b6
b6gm6n
04-06-2006, 02:13 AM
Not mentioned in the instructions (with zip) about altering the query for your database, please explain the query to us
$photo_query=$vbulletin->db->query_read("SELECT userid FROM photos");
while ($inids = $vbulletin->db->fetch_array($photo_query)) {
$posid = $inids[userid];
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field6 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field6 != 'Yes'");
} <- thats mine, no photopost field prefix and is "userfield.field6" corresponding to the id of the new profile field or what?, ( was set to userfield.field61 ) ive run the cron with no errors, i suppose we have to update thread information or any update counters also before anything shows, besides running the cron...? as yet nothing for me showing... unless i remove the if statement "<if condition="$post['6'] == 'Yes'">"
and what this ? > ../gallery/showgallery.php/cat/500/ppuser/$post[userid]
/cat/500/ppuser? your using search engine friendly, im not...
?cat=500&ppuser=$post[userid]
(for me)
-b6
scottct1
04-06-2006, 05:57 PM
Not sure why mine is not working...
My pp database is in the same one I use for vbulletin not a seperate database.
Here is my gallery.php file. My custom field is feild8.
If I go into my database (database name is satellit_vb) and go to the userfield I can input Yes in field 8 and then it shows up, so this shows me it is not looking at the photopost database correctly.
Any ideas?
<?
////////////////////////////////////////////
// MAKE SURE YOU EDIT THIS WHERE STATED //
// Then upload to /includes/cron/ //
////////////////////////////////////////////
// Edit - Make sure this is correct
define('FILE_VERSION', '3.5.4'); // this should match install.php
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
exit;
}
// Edit this line to reflect your database structure
$photo_query=$vbulletin->db->query_read("SELECT userid FROM pp_photos");
while ($inids = $vbulletin->db->fetch_array($photo_query)) {
$posid = $inids[userid];
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field8 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field8 != 'Yes'");
}
log_cron_action("gallery task updated", $nextitem);
?>
scottct1
04-08-2006, 06:05 AM
Yes that works well thank you!
KBowers
05-08-2006, 11:48 PM
I'm trying to get this to work, but I'm getting the following error messages:
Database error in vBulletin 3.5.4:
Invalid SQL:
SELECT userid FROM mustangg_photopost.pp_photos;
MySQL Error : Access denied for user 'mustangg_bowers'@'%' to database 'mustangg_photopost'
Error Number : 1044
Date : Monday, May 8th 2006 @ 04:30:20 PM
Script : http://www.mustanggt.org/forums/cron.php?&rand=503085
Referrer : http://www.mustanggt.org/forums/showthread.php?t=41439
IP Address : 69.117.185.102
Username : Unregistered
Classname : vb_database
I'm assuming I'm getting this error message because I have my photopost database separate from my vbulletin database (and it requires different users - mustangg_bowers is the user for my vbulletin database and mustangg_bowers1 is the user for my photopost database). Is there anyway around this??
Help! :bunny: Thanks!
KBowers
05-09-2006, 07:01 PM
I'm not sure if you can use other username/passwords using the vbulletin mysql functions, I'll have a look at this though and report back.
The separate databases and different usernames have not been an issue with anything else I have done on my vBulletin board and Photopost gallery. This is the first time I've run into problems with it... I've already done numerous mods without issues.
vBulletin board - http://www.mustanggt.org/forums/index.php
Photopost gallery - http://www.mustanggt.org/photopost/index.php
Thanks.
KBowers
05-09-2006, 07:28 PM
If you could provide a link to the hack you use to display the images on your forum homepage that could help me.
Thanks.
Here you go... http://www.photopost.com/forum/showthread.php?t=121970
Thanks!
KBowers
05-10-2006, 12:30 PM
I'd imagine adding the following from the hack you have installed
$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"); (replacing dbuserid and dubuserpassword with your correct details) to the gallery.php above the "$photo_query" line might do it.
OK, I tried that and I still get the same error message as I posted above... :cross-eyed:
Can this work for vbAdvanced Gallery?
criscokid
05-14-2006, 05:59 PM
My gallery.php contains the following:
$photo_query=$vbulletin->db->query_read("SELECT userid FROM photo-gallery.photos");
When trying to exect the file through cron I get the following error message:
Invalid SQL:
SELECT userid FROM photo-gallery.photos;
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-gallery.photos' at line 1
Error Number : 1064
It's almost as if the PHP doesn't like the '-' in my database name. Anyway to fix this?
Schahab
05-15-2006, 10:36 AM
Great JOB!
Works fine! Thank you very much!
criscokid
05-16-2006, 09:43 AM
My gallery.php contains the following:
$photo_query=$vbulletin->db->query_read("SELECT userid FROM photo-gallery.photos");
When trying to exect the file through cron I get the following error message:
Invalid SQL:
SELECT userid FROM photo-gallery.photos;
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-gallery.photos' at line 1
Error Number : 1064
It's almost as if the PHP doesn't like the '-' in my database name. Anyway to fix this?
Anyone able to offer any assistance?
KBowers
05-18-2006, 01:59 PM
Really not sure on that one at all.
Darn... oh well... if anyone can figure this out I'd really appreciate the info.
criscokid
05-21-2006, 09:31 AM
criscokid, maybe try putting ' either side of the database/table name? 'photo-gallery.photos'?
Done that - now running this scheduled task results in the following error message being displayed:
Parse error: parse error, unexpected T_STRING in \wwwroot\forums\includes\cron\gallery.php on line 21
This is line 21 of gallery.php:
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field38 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field38 != 'Yes'");
SHalliday
06-06-2006, 10:50 AM
This is an absolutely awesome hack! It's exactly how a gallery check should be setup for postbit processing.
Unfortunately my forums and classifieds are setup in separate databases and after spending a considerable amount of time yesterday and today, I still have not been able to get this to work. The problem is most likely my lack of php skills and mysql knowledge. I desparately want to implement this hack. Can anyone please help outy posting a gallery.php cron file that works for separate databases. I will gladly pay for this.
From looking at another hack that retrieves the most recent photos for memberinfo display, the connection code looks like it should be something like this:
$pppath = "/www/allfordmustangs.com/photopost";
require "{$pppath}/config-int.php";
$link = mysql_connect ("$host_bb", "$user_bb", "$password_bb") or die("Could not connect to the PhotoPost Classifieds database.");
mysql_db ("photopost", $link)or die("Could not select Photopost database");
$db_link = mysql_connect("$host_bb", "$user_bb", "$password_bb") or die ("Could not connect to the Members database.");
Could the problem here be that it needs to be connected to two databases at the same time? One to fetch and the other to update? I am sure my lack of knowledge here is really showing through. Everything else seems straightforward but the gallery.php is killing me.
Any and all help with this would be greatly appreciated.
Regards,
Scott Halliday
criscokid
06-06-2006, 11:38 AM
Done that - now running this scheduled task results in the following error message being displayed:
Parse error: parse error, unexpected T_STRING in \wwwroot\forums\includes\cron\gallery.php on line 21
This is line 21 of gallery.php:
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field38 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field38 != 'Yes'");
I still haven't been able to solve this problem - anyone able to assist?
StuntFactoryX
07-04-2006, 09:07 PM
Database error in vBulletin 3.5.4:
Invalid SQL:
SELECT userid FROM photopost.pp_photos;
MySQL Error : SELECT command denied to user 'stuntfac_johnny'@'localhost' for table 'pp_photos'
Error Number : 1142
Date : Tuesday, July 4th 2006 @ 04:00:49 PM
Script : http://www.stuntfactoryx.com/forum/admincp/cronadmin.php?do=runcron&cronid=15
Referrer : http://www.stuntfactoryx.com/forum/admincp/index.php
IP Address : 205.188.117.8
Username : Johnny
Classname : vb_database
im getting this error. any ideas? my vb3.5.4 does not use a prefix and my photopost uses the default pp_ and everything is in the same database. that is my user name and my database is stuntfac_vb
StuntFactoryX
07-10-2006, 03:50 AM
hmm interesting. i get this error when trying to run scheduled task. i checked w/phpmyadmin, the table is there. i have hacks installed to display random pics on forum home ect. and my gallery works fine and intergrates fine w/ my forums. its the only username and database i have. any ideas of things i could check permission wise that i could have overlooked?
Schahab
08-08-2006, 04:57 PM
Good Job, but don't work with Vbulletin 3.6 any Ideas?
Schahab
08-14-2006, 04:44 PM
Nobody can help?
Schahab
08-14-2006, 05:05 PM
Hello,
I don't get an error, the button don't appear... :-(
ubblite
08-15-2006, 06:24 AM
I'm trying to get this to work, but I'm getting the following error messages:
Database error in vBulletin 3.5.4:
Invalid SQL:
SELECT userid FROM mustangg_photopost.pp_photos;
MySQL Error : Access denied for user 'mustangg_bowers'@'%' to database 'mustangg_photopost'
Error Number : 1044
Date : Monday, May 8th 2006 @ 04:30:20 PM
Script : http://www.mustanggt.org/forums/cron.php?&rand=503085
Referrer : http://www.mustanggt.org/forums/showthread.php?t=41439
IP Address : 69.117.185.102
Username : Unregistered
Classname : vb_database
I'm assuming I'm getting this error message because I have my photopost database separate from my vbulletin database (and it requires different users - mustangg_bowers is the user for my vbulletin database and mustangg_bowers1 is the user for my photopost database). Is there anyway around this??
Help! :bunny: Thanks!
Same problem here. I tried the suggested fix by mini2 but still had the same error. Any other ideas?
glowinggal
09-27-2006, 11:11 AM
yea we have our forum and gallery on separate databases and too have an issue of sorts... here is our error we got:
Database error in vBulletin 3.6.0:
Invalid SQL:
UPDATE userfield SET field61 = 'Yes' WHERE userfield.userid = 0 AND userfield.field61 != 'Yes';
MySQL Error : Unknown column 'userfield.field61' in 'where clause'
Error Number : 1054
Date : Wednesday, September 27th 2006 @ 08:10:50 AM
Script : http://www.vvvvv.com/chat/admincp/cronadmin.php?do=runcron&cronid=20
Referrer : http://www.vvvvv.com/chat/admincp/cronadmin.php?do=modify
IP Address : 66.24.45.98
Username : pcloadmin
Classname : vb_database
mattselley
11-11-2006, 06:57 PM
hi,
i get this error when trying to run the scheduled task in 3.6.2
Database error in vBulletin 3.6.2:
Invalid SQL:
SELECT userid FROM photopost.pp_photos;
MySQL Error : SELECT command denied to user 'mattsell_mattsel'@'localhost' for table 'pp_photos'
Error Number : 1142
Date : Saturday, November 11th 2006 @ 02:43:09 PM
Script : http://www.xxxxxxx.com/forum/admincp/cronadmin.php?do=runcron&cronid=19
Referrer : http://www.xxxxxxx.com/forum/admincp/index.php
IP Address : 195.93.21.133
Username : Matt
Classname : vb_database
vb and pp both share the same database, and are both clean installs
any help would be great
kellogs
12-05-2006, 07:16 PM
I tried to run the cron job manually using vbadmincp and it says Done.
But when i go to forum, i did not see the link?
User has photos in the photopost.
Where was wrong?
Thanks,
-K
kellogs
12-05-2006, 07:51 PM
It is resolved now!!!
Have to explicitly insert the field number in the postbit legacy :)
It is an awesome mod!!!
Thank you Mini :knockedout:
-K
seabiscuit
12-11-2006, 12:18 AM
hi,
i get this error when trying to run the scheduled task in 3.6.2
Database error in vBulletin 3.6.2:
Invalid SQL:
SELECT userid FROM photopost.pp_photos;
MySQL Error : SELECT command denied to user 'mattsell_mattsel'@'localhost' for table 'pp_photos'
Error Number : 1142
same problem here. That makes at least three users here.
funkmeister
12-12-2006, 12:50 PM
To clarify......in 'gallery.php' do we replace the field id number (field61 in the example below) with whatever our field number is, which is created earlier in the instructions?
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field61 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field61 != 'Yes'");
Thanks in advance.
Grunt
02-20-2007, 08:25 AM
Thanks once again Mini - good stuff.
Working in 3.6.4 and PP 5.6.2 (sharing DB and no prefixes on either). I had to modify code a bit. Working code if it helps anyone is:
postbit:
<if condition="$post['field7'] == 'Yes'">
<a href="/gallery/showgallery.php?cat=500&ppuser=$post[userid]" target="_blank">
<img class="inlineimg" src="$stylevar[imgdir_misc]/gallery.gif" alt="View $post[username]'s Gallery" width="19" height="18" border="0" title="View $post[username]'s Gallery" /></a>
</if>
gallery.php:
<?
////////////////////////////////////////////
// MAKE SURE YOU EDIT THIS WHERE STATED //
// Then upload to /includes/cron/ //
////////////////////////////////////////////
// Edit - Make sure this is correct
define('FILE_VERSION', '3.6.4'); // this should match install.php
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
exit;
}
// Edit this line to reflect your database structure
$photo_query=$vbulletin->db->query_read("SELECT userid FROM photos");
while ($inids = $vbulletin->db->fetch_array($photo_query)) {
$posid = $inids[userid];
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field7 = 'Yes' WHERE ".TABLE_PREFIX."userfield.userid = $posid AND ".TABLE_PREFIX ."userfield.field7 != 'Yes'");
}
log_cron_action("gallery task updated", $nextitem);
?>
Grunt
02-20-2007, 08:31 AM
and a different icon
SherryG
02-23-2007, 08:12 PM
*Solved*
atvtrailrider
03-21-2007, 05:46 PM
Here is the error I am getting when it runs the cron:
> MySQL Error : Access denied for user 'vborforumuser'@'localhost' to database 'photopost'
vborforumuser is set as the "User Database User" in my photopost config. I think the task needs to use my "PhotoPost Database User" instead. How do I get the task to run as a different user?
Suggestions?
Doug Nelson
04-27-2007, 02:54 PM
Has this been updated for 3.6.5?
Doug Nelson
05-03-2007, 02:59 AM
That would be a "no"?
PEPITO69
08-10-2007, 07:04 PM
Is it possible to make the same with reviewpost? showing the reviews of a member.
sgrynd
08-17-2007, 03:26 PM
Thanks, great hack - running on 3.7 as well.
For those with the db error, make sure gallery.php is set to use the correct database and table name
mirzonni
09-19-2007, 08:06 PM
It works with 3.6.8 after some minor modifications. Excellent hack! Cheers.
stuartn
10-06-2007, 05:21 PM
works a treat thanks, had a couple of errors, but my fault re-read the alterations and now its champion.
iRO Wiki
11-30-2007, 03:53 PM
I don't understand why the default is set to yes, doesn't that mean everyone will show as having a gallery?
Seems it should default to no first, then the cron sets it to yes?
dutchbb
01-27-2008, 05:04 PM
Hello, where's the update for this hack please!!!
iRO Wiki
01-28-2008, 08:26 AM
I'll post what I did to get this working in 3.6.8 later, likely as a new mod or something...
Edit: using parts of this (former?) mod there's a new one here for 3.6.8:
https://vborg.vbsupport.ru/showthread.php?t=169304
dutchbb
01-28-2008, 01:54 PM
Thank you! I'm sure that will be appreciated by many :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.