Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-10-2003, 04:34 PM
mADmAX` mADmAX` is offline
 
Join Date: Dec 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to check version...

I am working on sort of a hack for vbulletin but will have its own admin control panel. I am trying to figure out how to check the version to see if there is an update, like vbulletin does in the admin control panel. How exactly do you do that?
Reply With Quote
  #2  
Old 05-11-2003, 04:46 AM
Black Vivi's Avatar
Black Vivi Black Vivi is offline
 
Join Date: Dec 2002
Location: United Kingdom
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try
PHP Code:
if ($templateversion==version you want)
{
    DO 
THIS
}
else
{
    DO 
THIS INSTEAD

Reply With Quote
  #3  
Old 05-11-2003, 06:19 AM
mADmAX` mADmAX` is offline
 
Join Date: Dec 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I am talking about how vb's admin cp says this...

You are running version xxx

Latest version is xxx

How do you get it to check via the javascript...

I see where it calls vbulletin.com but unsure how to make a script that it calls.

So that way my hack (which has its own cp) will check if a newer version available.
Reply With Quote
  #4  
Old 05-11-2003, 12:59 PM
Black Vivi's Avatar
Black Vivi Black Vivi is offline
 
Join Date: Dec 2002
Location: United Kingdom
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

as far as i know, the version.js script is just this:
Quote:
var vb_version = 'latest version';
var vb_announcementid = 'latest version thread';
the, to make it display it, they use this code in the ACP:
Code:
<script language="Javascript">
if ('<?php echo $templateversion; ?>' < hack_version)
{
    document.write("<div align=\"center\" class=\"tblhead\" style=\"padding:4px\"><b><a href=\"http://vbulletin.com/forum/showthread.php?postid="+vb_announcementid+"\"><span class=\"tblhead\"><font size=\"2\">There is a newer version of vBulletin than the version you are running!</font></span></a></b>");
    document.write("<br><a href=\"http://vbulletin.com/members/\"><span class=\"tblhead\">Download vBulletin version "+vb_version+" from the Members' Area</span></a>.</div>");
}
</script>
so, for u, it cud be this:
JS script:
Quote:
var hack_version = 'latest version';
var hack_announcementid = 'latest version thread';
and this to display it:
Code:
<script language="javascript">
if ('<?php echo($templateversion); ?>' < vb_version)
{
    document.write("<div align=\"center\"><b><a href=\"FORUM URL/showthread.php?postid="+hack_announcementid+"\"><font size=\"2\">There is a newer version of HACK NAME than the version you are running!</font></a></b></div>");
}
</script>
hope thats what u meant.
don't forget to call it with the script tags first
Reply With Quote
  #5  
Old 05-11-2003, 04:54 PM
mADmAX` mADmAX` is offline
 
Join Date: Dec 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, that worked =P

Didnt think it was that simple. I see checkversion coming to vbulletin.com. Do you know what needs to be inside that or does vbulletin allow me to run that (cause it works fine just caling it from them).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03505 seconds
  • Memory Usage 2,198KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete