View Full Version : Version Check in vb3.6
rogersnm
06-11-2006, 02:43 PM
What exactly do you put in the target page for a version check?
Regards,
Nick.
PS. Someone must know but i don't.
derekivey
06-11-2006, 02:46 PM
You have to put the following on a page:
<version productid="x">1.2.3</version>
I made myself a PHP script that I just put my hacks version info in a database and it prints it out for me for each of my hacks.
rogersnm
06-11-2006, 02:47 PM
thanks, could you share the script?
derekivey
06-11-2006, 03:00 PM
Sure let me zip it up. I'll edit my post and attach the script in a sec.
Derek
Here is the script:
<?php
if ($_REQUEST['product'])
{
mysql_connect('localhost', 'username', 'password') or die('<strong>Error:</strong> Could not connect to the MySQL Server.');
mysql_select_db('database') or die('<strong>Error:</strong> Could not select database.');
$query = "SELECT version FROM versions WHERE productid = '" . mysql_real_escape_string($_REQUEST['product']) . "' LIMIT 1";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
if ($num_rows == 1)
{
$info = mysql_fetch_array($result);
print '<version productid="' . $_REQUEST['product'] . '">' . $info['version'] . '</version>';
}
else
{
exit;
}
}
else
{
exit;
}
?>
And you will need to create a database, edit the script code with the database info, and import the following SQL:
CREATE TABLE `versions` (
`id` int(10) unsigned NOT NULL auto_increment,
`productid` varchar(50) NOT NULL default '',
`version` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
INSERT INTO `versions` VALUES (1, 'productid', '1.0.0');
You will have to manually add products through PHPMyAdmin.
For the version check field in vB's product manage just type http://www.yourdomain.com/file_name_of_script.php?product=yourscriptsproduct id
Derek
Revan
06-11-2006, 03:28 PM
Thanks for the script, but why not use the version column in the product table already in vBulletin?
Revan i think that's for the version checker on your own website. But not sure.
Revan
06-11-2006, 03:50 PM
Yeah but its quite possible to get that to connect to a vB database too ennit :p
derekivey
06-11-2006, 04:10 PM
Didn't think of that. Good idea!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.