vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Version Check in vb3.6 (https://vborg.vbsupport.ru/showthread.php?t=118318)

rogersnm 06-11-2006 02:43 PM

Version Check in vb3.6
 
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:
Code:

<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 Code:

<?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:
[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');
[/sql]

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_...riptsproductid

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?

Dan 06-11-2006 03:31 PM

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!


All times are GMT. The time now is 10:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01233 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete