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?
Code:
<?
////////////////////////////////////////////
// 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);
?>