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)

Dunny 09-09-2001 12:14 PM

1 - Add to database-Table user, field named: country
properties: ( country varchar(50) NOT NULL )

In phpMyAdmin, you can run this query:
ALTER TABLE user ADD country VARCHAR (50) NOT NULL


any chance of making this step better for the simple people among us ;)

webhost 09-09-2001 04:18 PM

Checking my installation and I have a question, look at this below the first instruction I can only find this line one time in user.php, it also mentions user.cp what is this, something doesn't look right in this section can you explain?

PHP Code:

Open admin/user.php

Find the FIRST line of this code 
(this shows up 2 times in user.cp):
      
makeinputcode("Birthday<br>(Format yyyy-mm-dd)","birthday");

Below it add:
// Country Hack CP Addon by Stasik (modded by AJ)
      
echo "<tr class='".getrowbg()."'><td>Country Flag</td><td nowrap>";
      eval(
"\$countrytext.= \"".gettemplate("modifyprofile_country")."\";");
      echo 
"$countrytext</td></tr>";
// Country Hack CP Addon End


Find the SECOND line of this code (this shows up 2 times in user.cp):
      
makeinputcode("Birthday<br>(Format yyyy-mm-dd)","birthday");

Below it add:
// Country Hack CP Addon by Stasik (modded by AJ)
      
$country=$user[country];
      
$countryalt str_replace("%20"," ",$country);
      
$countrysel str_replace("%20","_",$country);
      if(
$user[country] == ""){
        
$ctrydefaultselected "selected";
        
$flag "No flag selected yet.";
      } else {
          
$ctryname "ctry".$countrysel."selected";
          $
$ctryname "selected";
        
$flag "<img src=\"../images/flags/$user[country].gif\" alt=\"$countryalt\" border=\"0\">";
      }
      echo 
"<tr class='".getrowbg()."'><td>Flag<br>$flag</td><td nowrap>";
      eval(
"\$countrytext.= \"".gettemplate("modifyprofile_country")."\";");
      echo 
"$countrytext</td></tr>";
// Country Hack CP Addon End


Find:
  
$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$styleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionhash=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$lastactivity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',emailnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");

Replace it with:
// Country Hack CP Addon by Stasik (modded by AJ) Replace
//  $DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$styleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionhash=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$lastactivity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',emailnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");
  
$DB_site->query("UPDATE user SET birthday='$birthday',options='$options',usergroupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$styleid',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,showemail=$showemail,invisible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cookieuser=$cookieuser,nosessionhash=$nosessionhash,daysprune='$daysprune',lastvisit=$lastvisit,lastactivity=$lastactivity,lastpost=$lastpost,posts='$posts',timezoneoffset='$timezoneoffset',country='$country',emailnotification=$emailnotification,receivepm='$receivepm',emailonpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");
// Country Hack CP Addon End 


Dunny 09-09-2001 04:37 PM

makeinputcode("Birthday<br>(Format yyyy-mm-dd)","birthday",$user[birthday],0);

i think the 2nd one looks like this mate...does anyone know how you do the first step exactly?

webhost 09-09-2001 04:41 PM

just go to your database for your forums. Find table named user open up find field name country and edit it change to VARCHAR (50) and save.

Anyone got the large flags renamed yet?

Dunny 09-11-2001 07:44 AM

can anyone really simplify the 1st step, I take it the person who owns the board has to do it?

I just have FTP access to install the hacks so Im completly lost and the board owner doesnt have a clue! :)

cheers

webhost 09-11-2001 07:54 AM

Dunny can not guarantee this but you can try it. Unzip then Load it in your admin directory and then try to run it.

Dunny 09-11-2001 07:05 PM

that worked perfect mate, thanks alot!

the file should be added to the release...

MrLister 09-12-2001 02:57 AM

great hack. i just installed it!

Alien 09-13-2001 06:34 PM

Works great, good job. :D

Mark Hewitt 09-15-2001 12:26 PM

A brilliant hack! I've put it on my site and I've also put it on my memberlist.


All times are GMT. The time now is 09:25 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.01222 seconds
  • Memory Usage 1,782KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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