vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Country Flag Hack v2.0 (https://vborg.vbsupport.ru/showthread.php?t=27485)

TECK 11-13-2002 06:24 PM

i hope you will get the rest of it, how to use the installer-uninstaller.
if you are not sure, erwin will be able to smack you in the head... heh, with explanations on how to use it. ;)

Harken 11-17-2002 09:21 PM

can anyone assist me this...im am still lost...

Bison 12-05-2002 12:45 AM

Anyone get this to work with vb 2.2.9?

I can't get past the member.php file before the code blows up!

Erwin 12-05-2002 01:07 AM

Works fine from 2.2.1 all the way to 2.2.9 on my forums.
Tip: Remember, EACH time you upgrade, you need to add the modifyprofile_country template AGAIN, and run the db query AGAIN.

Bison 12-05-2002 02:54 AM

I did that part already, but the member.php file fowls up everything right after uploading the file!

Someone willing to share their file with me?

Logician 12-05-2002 01:42 PM

Firstly great hack and althought installation steps are a little bit long, it works ok in v.2.2.9! Thx for sharing.. :)

And a few comments that might help some people while installing:
If these are already mentioned in the hack thread, my apologies..
VBSTATS and THIS HACK
If you use Bane's vbstat hack the image directory's of these 2 hacks clashes. To use them both, I applied such a method:

1- rename image directory of this hack to cflags and edit these files:

memberlist.php
member.php
functions.php
user.php

find: images/flags/
Replace it AS: images/cflags/

Now you can use 2 hacks together..

ASSIGNING TEMPLATE TO DEFAULT SET:
Quote:

*** The 'modifyprofile_country' template needs to be changed
to a default original templatesetid of -1 or else the Admin CP addon
will not show the country select list (Any ideas why?).
This is because vb Admin CP logins does not set $templatesetid variable.

To cure this edit user.php and find:
PHP Code:

 eval("\$countrytext.= \"".gettemplate("modifyprofile_country")."\";"); 

(There are 2 instances)

Before that add:
PHP Code:

 $templatesetid=1

Now you can create your template in the default set and you dont need to run UPDATE template SET templatesetid="-1" where title="modifyprofile_country" query which will be overwritten after you upgrade your board..

Hope this helps..

Enjoy.

Ps. I dont have subscription in this thread, so do not address me here, ty..

stryka 12-09-2002 01:52 AM

there are subtle code differences in 2.2.9 vs the documentation for the country hack... so here's the members.php instructions to match 2.2.9

4 - Open member.php

find:
$templatesused = 'register_birthday,modifyprofile_customtext,regist er_customfields,usercpnav,modi fyprofile';

Replace it with
// Country Hack Replace
// $templatesused .= "register_birthday,modifyprofile_customtext,regist er_customfields,usercpnav,modi fyprofile";
$templatesused .= "register_birthday,modifyprofile_customtext,modify profile_country,register_custo mfields,usercpnav,modifyprofile";
// Country Hack End

find:
eval("\$customtext = \"".gettemplate("modifyprofile_customtext")."\";") ;
}
}
Below it add:
// Country Hack
if (!$getcountry=$DB_site->query_first("SELECT country FROM user WHERE userid=$bbuserinfo[userid]")) {
$country="";
$ctrdefaultselected = "selected";
} else {
$country="$getcountry[country]";
$countryalt = str_replace("%20"," ",$country);
$countrysel = str_replace("%20","_",$country);
$flag="<img src=\"images/flags/$country.gif\" alt=\"$countryalt\" align=\"absmiddle\" border=\"0\">";
$ctryname = "ctry".$countrysel."selected";
$$ctryname = "selected";
}
eval("\$countrytext.= \"".gettemplate("modifyprofile_country")."\";") ;
// Country Hack End

find:
$DB_site->query("UPDATE user SET birthday='".addslashes($birthday)."',signature='". addslashes($signature)."',cust omtitle='".intval($customtitle)."',usertitle='".ad dslashes($customtext)."',email ='".addslashes(htmlspecialchars($email))."',parent email='".addslashes(htmlspecia lchars($parentemail))."',coppauser='$coppauser',ho mepage='".addslashes(htmlspeci alchars($homepage))."',icq='".addslashes(htmlspeci alchars($icq))."',aim='".addsl ashes(htmlspecialchars($aim))."',yahoo='".addslash es(htmlspecialchars($yahoo))." ',usergroupid='$bbuserinfo[usergroupid]' WHERE userid='$bbuserinfo[userid]'");

Replace it with:
// Country Hack Replace
// $DB_site->query("UPDATE user SET birthday='".addslashes($birthday)."',signature='". addslashes($signature)."',cust omtitle='".intval($customtitle)."',usertitle='".ad dslashes($customtext)."',email ='".addslashes(htmlspecialchars($email))."',parent email='".addslashes(htmlspecia lchars($parentemail))."',coppauser='$coppauser',ho mepage='".addslashes(htmlspeci alchars($homepage))."',icq='".addslashes(htmlspeci alchars($icq))."',aim='".addsl ashes(htmlspecialchars($aim))."',yahoo='".addslash es(htmlspecialchars($yahoo))." ',usergroupid='$bbuserinfo[usergroupid]' WHERE userid='$bbuserinfo[userid]'");
$DB_site->query("UPDATE user SET birthday='".addslashes($birthday)."',signature='". addslashes($signature)."',cust omtitle='".intval($customtitle)."',usertitle='".ad dslashes($customtext)."',email ='".addslashes(htmlspecialchars($email))."',parent email='".addslashes(htmlspecia lchars($parentemail))."',coppauser='$coppauser',ho mepage='".addslashes(htmlspeci alchars($homepage))."',icq='".addslashes(htmlspeci alchars($icq))."',aim='".addsl ashes(htmlspecialchars($aim))."',yahoo='".addslash es(htmlspecialchars($yahoo))." ',usergroupid='$bbuserinfo[usergroupid]',country='".addslashes($country)."' WHERE userid='$bbuserinfo[userid]'");
// Country Hack End

find:
if ($userinfo[yahoo]!="") {
eval("\$userinfo[yahooicon] = \"".gettemplate("yahoo")."\";");
} else {
$userinfo[yahoo]="&nbsp;";
}

Below it add:
// Country Hack
$getctry=$DB_site->query_first("SELECT country FROM user WHERE userid=$userid");
$country=$getctry[country];
$countryalt = str_replace("%20"," ",$country);
if ($country!="") {
$flag = "<img src=\"images/flags/$country.gif\" alt=\"$countryalt\" align=\"absmiddle\" border=\"0\">";
} else {
$flag = "";
}
// Country Hack End

Bison 12-09-2002 02:33 AM

BINGO! ... that worked like a charm!

Thanks, you two! :D

0zone 01-25-2003 04:22 PM

Hey everyone, I'm new to vB, I pruchased it yesterday, and I would really like this hack. I'm so unfamiliar with all of these hacks but I am trying to learn.

Would someone be able to possibly help me install this hack?

Tony DiMera 01-26-2003 10:10 PM

Thanks a lot


All times are GMT. The time now is 11:02 PM.

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.02078 seconds
  • Memory Usage 1,752KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete