View Single Post
  #18  
Old 03-16-2005, 05:35 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revan
I am curious, exactly what changes do your users have to make? And I am equally curious as to why YOU had to change the files? I did provide you with all files and vB file edits 100% (if we disregard the if() problem above) working, so if you are indeed saying that you manually changed all files from YesNo to 1/0, then...meh I will keep my comments to myself
It's not like you have provided patch instructions for file upgrades for a long time, you always just say "reupload $files".
Of course, you CAN use Yes/No with the $vboptions as they are setup now, but it's more "vBish" to use 1/0
Yes/No, 1/0, whatever. It is of no difference
Revan,

You are right, I do not provide patch instructions for AWS files. But you are forgetting one thing. AWS users have to change other php files too, such as showthread, editpost etc. The files you provided are perfect for a new installation (some minor issues were corrected, not important), but what about the other files? Files where checks are made to "Yes" or "No"? Also, they have to edit their already-changed templates, to change the comparisons from $hierarchical=='Yes' to $hierarchical==1 for example.When I come out with a new version, instructions are given on how to patch your files, in order to bring AWS up to the latest version. If you want to see what the instructions are (at this moment), have a look:

Code:
UPGRADE FROM VERSION 3.2.0 TO VERSION 3.3.0
-------------------------------------------

THIS IS A MAJOR UPDATE, SO PLEASE BACKUP YOUR DATABASE BEFORE PROCEEDING. ALSO, BACKUP YOUR php FILES BEFORE CHANGING ANYTHING.

With this release, one of the hack's tables is ommited and it is replaced with a new settings group. The reason for this, was to reduce the number of queries generated by the warning system. Even though this is not a query-intensive hack, I decided to do this change, in order to improve it even further. The idea behind this change originated from Revan (in vBulletin.org) who was instrumental in pushing me to do it.

In order to complete the update, several steps should be made, in the right order and in the proper sequence. Here are the steps you should follow.


1. Shut down your forums. This is not absolutely necessary, but it is a good precaution.


2. Upload all the files found in the zip file to your web server, in the proper directories.


3. Execute the following script from your admincp directory:

	http://www.yoursite.com/admincp/vboptions_update.php
	
	(replace the url above with the proper one. Also, make sure you enter the proper location for your admincp, in case it is not the standard one)

	This step deletes the previous set of templates that AWS was using and is replacing them with new ones, which use the $vboptions variables.	

	
4. Execute the following script from your admincp directory:

	http://www.yoursite.com/admincp/warn_install_setting.php
	
	This step will read your warning_options table and generate the necessary $vboptions variables, in your system.

		
5. Open your admincp/index.php file and find:

	$DB_site->reporterror = 0;
	$query="select * from ".TABLE_PREFIX."warning_options where oid='1'";
	$DB_site->query($query);
	$errornum = $DB_site->geterrno();
	if ($errornum == '1146')
	{
		$aws='0';
	}
	else
	{
		$DB_site->reporterror = 1;
		$warn_opts=$DB_site->query_first("select * from ".TABLE_PREFIX." warning_options where oid='1'");
		$aws='1';
	}
	
	
Delete that part entirely. It was used to make sure the warning_options table existed. Now this table is obsolete.

In the same file find:

// *************************************
// AWS Reminder
if ($aws=='0')
{
print_form_header('index', 'reminder');
print_table_header('Attention: Your files contain AWS code',1);
print_description_row('This file (admincp/index.php) probably contains code, associated with the Advanced Warning System (AWS).<p>If you have removed AWS from your system, you should also remove all the changes that you have done, in your PHP files and templates. Failing to do so, will lead to unexpected results. <p>Please clean up your files from changes done by AWS.');
print_table_footer();
}

Delete that section.

In the same file, find:

	if ($warn_opts['automaticpm'] == 'Yes')
	{
			construct_nav_option ( 'View Auto-Warned PMs', 'admin_warn.php?act=viewwarnedpms', '<br />' ) ;
	}

Replace that with:

	if ($vboptions['warn_automaticpm'] == 1)
	{
		construct_nav_option('View Auto-Warned PMs', 'admin_warn.php?act=viewwarnedpms', '<br />');
	}
	
Save file and upload.


6. Edit the following files:

showthread.php
member.php
newreply.php
editpost.php
private.php
newthread.php

In all those files, find every occurence of the text:

$warn_opts['

and replace it with the text

$vboptions['warn_

In the following files:

newreply.php
editpost.php
newthread.php

now find:

if ($vboptions['warn_automatic'] == 'Yes')

Replace that with:

if ($vboptions['warn_automatic'] == 1)

In the file private.php, find:

if ($vboptions['warn_automaticpm'] == 'Yes')

Replace that with:

if ($vboptions['warn_automaticpm'] == 1)

Save and upload all files.


7. Edit functions.php and find:

$warn_opts=$DB_site->query_first("select * from ".TABLE_PREFIX."warning_options where oid='1'");

Delete that line.

In the same file find every occurence of text:

$warn_opts['

and replace it with the text

$vboptions['warn_


8. Open your MEMBERINFO template and find:

$warn_opts[allowoffpost]=='Yes'

Replace that with

$vboptions[warn_allowoffpost]==1

Also find replace occurence of 

$hierarchical=='No' 

with 

$hierarchical==0 

and every occurence of 

$hierarchical=='Yes'

with

$hierarchical==1


9. Open your postbit/postbit_legacy templates and replace every occurence of 

$hierarchical=='No' 

with 

$hierarchical==0 

and every occurence of 

$hierarchical=='Yes'

with

$hierarchical==1
On the other hand, if I change the AWS files, (basically admin_warn.php. Warn.php, functions_warning.php and your install script as it was initially) to use Yes/No, instead of 1/0, then the existing users of the hack, have to change only one thing in their files and templates : $warn_opts[' to $vboptions['warn_ and that's it.
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01107 seconds
  • Memory Usage 1,801KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete