I'd imagine adding the following from the hack you have installed
Code:
$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:
$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?
$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?
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'");
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:
Code:
$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.
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?
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