PDA

View Full Version : Country Flag Hack v2.0


Pages : [1] 2

AJR
09-05-2001, 10:00 PM
UPDATED TO v2.1 - 3/11/2002

Version 2.1 - March 11, 2002
================================================== ==
Well, it's been awhile! I sorta disappeared there while
doing many other things! I guess v2.0 that was supposed
to use the same images as vBStats didn't go as planned
(thanks Bane :)). I removed this hack from my site
awhile ago when I was having some other problems. I have
finally decided to add it back and it worked great in 2.2.0,
and I'm sure it will work in all other 2.2.x versions.

Changes:
- Updated to work with vBulletin 2.2.x
- Added Display Flag in Member List - Thanks Orca
- Used slightly larger flag images by X-Fan (I did run
them through Ulead's 16-color optimization which cut
the total file size from 271K to 54K!)
- Added 'align="absmiddle"' to image tag for text vertical centering
- Fixed Bane's name in docs below where I botched it up!
- Support for 280 Countries


Version 2.0 - September 6, 2001
================================================== ==
Changes from v1.0:
- Images have been changed from country codes to country names
- Flags will now have their ALT text as country name.
- Modified Hack to work with Bane's vbStats hack that will be released in the future.
- Added CP Addon by Stasik and modded it for new country names
- Changed country field in USER table from CHAR(2) to VARCHAR(50)
- Support for 226 countries

Known Problems:
- Countries with a dash (-) or comma (,) will not show up
automatically in as selected when you or the member edit
their profile (Congo, Korea, and Micronesia are the only 3)
Anyone know a fix please let me know.
- The 'modifyprofile_country' template needs to be changed
to a default original templatesetid of -1 (changed templates
have the templatesetid set to 2) or else the Admin CP addon
will not work (Any ideas why?). To do this, use phpMyAdmin
and run this query:
UPDATE template SET templatesetid="-1" where title="modifyprofile_country"
This will move the template from the custom to default templates
and will be found in the 'User Option Templates' group.

Any questions or comments can be posted here. Enjoy!

webhost
09-06-2001, 09:14 AM
AJR

Thanks for the update.

Question, I am upgrading, in the new zip file I only see the small flags, I am using the large flags.Do you also have them somewhere laying around with full names like the small flags in your new zip file?

AJR
09-06-2001, 10:29 AM
Webhost... I do not have the large flag names converted because the vBStats Hack by Bane, when released, will require the small flags as the same name as the Country Hack.

If you want to use the large flags and don't plan on using the vBStats hack, rename the large flags that you have with the names from the modifyprofile_country template. If I get a chance I'll do it and post them, but it won't be for a day or two. If you are planning on using the vbstats hack, for now you can keep the names as country codes and just use the modifyprofile_country template from v1.0 text file... make sure to only grab from:

<select name="country">
.
.
.
</select></smallfont>

Do not at the <td><smallfont> or </td> before and after since they are being put into the other templates. The plus is you won't have the problem with the 3 countries that have - or ,. The only drawback to this is the ALT name will not be shown as the full country name. If anyone gets time to convert the large flags from country code to country name before I do, please post them here.

aldamon
09-07-2001, 10:51 AM
Nevermind, my bad....

Great work! Excellent hack!

redrat
09-08-2001, 10:12 AM
Great hack :D
Thanks a lot

TheComputerGuy
09-08-2001, 12:24 PM
I get a dB error on the member.php file when I try to go edit my country

the error is saying that it is sending an email to me...just a slight problem as it says

Typhon
09-08-2001, 02:05 PM
This is a great hack... and it works like a charm on my site. I'm currently in the process of converting all the flags to a beveled 30x15 pixels, and I'll post the ZIP files when I get it done. Thanks!

AJR
09-08-2001, 04:11 PM
Originally posted by TheComputerGuy
I get a dB error on the member.php file when I try to go edit my country

the error is saying that it is sending an email to me...just a slight problem as it says

And......what was the email that was sent to you (the db error)? That is the key to helping you with your problem.

TheComputerGuy
09-08-2001, 07:15 PM
> Database error in vBulletin: Invalid SQL: SELECT country FROM user WHERE
userid=1
> mysql error: Unknown column 'country' in 'field list'
> mysql error number: 1054
> Date: Saturday 08th of September 2001 01:44:45 PM
> Script: /forums/member.php?s=&action=getinfo&find=lastposter&forumid=31
> Referer: http://www.moneytec.com/forums/index.php?s=

AJR
09-08-2001, 07:28 PM
Originally posted by TheComputerGuy
> mysql error: Unknown column 'country' in 'field list'


It tells you the problem right in the error message. You didn't do STEP 1 in the country_flag_hack_20.txt file:

STEP 1:
======
In phpMyAdmin, you can run this query to create the country field:
ALTER TABLE user ADD country VARCHAR (50) NOT NULL


If the field 'country' is not there it can't save the country selection!

AJ

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?


5 - 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',usergroupi d='$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,invi sible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cook ieuser=$cookieuser,nosessionhash=$nosessionhash,da ysprune='$daysprune',lastvisit=$lastvisit,lastacti vity=$lastactivity,lastpost=$lastpost,posts='$post s',timezoneoffset='$timezoneoffset',emailnotificat ion=$emailnotification,receivepm='$receivepm',emai lonpm='$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',usergroupi d='$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,invi sible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cook ieuser=$cookieuser,nosessionhash=$nosessionhash,da ysprune='$daysprune',lastvisit=$lastvisit,lastacti vity=$lastactivity,lastpost=$lastpost,posts='$post s',timezoneoffset='$timezoneoffset',emailnotificat ion=$emailnotification,receivepm='$receivepm',emai lonpm='$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',usergroupi d='$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,invi sible=$invisible,usertitle='".addslashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cook ieuser=$cookieuser,nosessionhash=$nosessionhash,da ysprune='$daysprune',lastvisit=$lastvisit,lastacti vity=$lastactivity,lastpost=$lastpost,posts='$post s',timezoneoffset='$timezoneoffset',country='$coun try',emailnotification=$emailnotification,receivep m='$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.

webhost
09-21-2001, 02:56 AM
First of three sets of big flags. 74x37 pixels

webhost
09-21-2001, 02:58 AM
Second Set of bigflags. The third set will be sometime tomorrow there are 71 in that group.
Total Flags of all three groups is 288

webhost
09-21-2001, 03:15 AM
Large Flags finished, you can download all three zip files now, These Flags have full names.

tkhjosh
09-21-2001, 04:22 AM
when i run flag.php this is what i get

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.


any help please?

AJR
09-21-2001, 04:33 AM
What does the email that is sent to the administrator say? That holds the key to where the problem is! It sounds like one of your $db queries was not typed in correctly (if you have other hacks installed it is easy to overwrite something from another hack), OR you didn't add the country field to the user table.

tkhjosh
09-21-2001, 05:05 AM
i ran the flag.php that webhost gave, not enough? there must be more to do?

AJR
09-21-2001, 05:10 AM
I need to know what that email said! Then I can help you.

tkhjosh
09-21-2001, 05:11 AM
Originally posted by webhost
Dunny can not guarantee this but you can try it. Unzip then Load it in your admin directory and then try to run it.

here here....

AJR
09-21-2001, 05:17 AM
Not the quote from webhost, the email that should have been sent to the admin of the vbulletin forum... it contains error information about the query that was run to cause the error!! That is the email that I need!

merk
09-21-2001, 05:23 AM
Thats why you shouldnt bother supporting your hacks AJR ;):D

tkhjosh
09-21-2001, 05:29 AM
Database error in vBulletin Control Panel: Invalid SQL: ALTER TABLE user ADD
country VARCHAR (50) NOT NULL

mysql error: Duplicate column name 'country'
mysql error number: 1060
Date: Friday 21st of September 2001 02:24:11 PM
Script: /forums/admin/flag.php?
Referer:

AJR
09-21-2001, 05:37 AM
You only need to run flag.php ONCE! This will create the field for country in the user table. After that you DON'T run flag.php again! Delete flag.php!

Make sure you have followed the rest of the instructions in the .txt file. All the php files that were edited need to be uploaded and everything should be working!

tkhjosh
09-21-2001, 05:48 AM
i tried replacing all the files with default and the same problem persist.

AJR
09-21-2001, 05:59 AM
First of all, you need to get ONE hack working before you start another. You seem to be simultaneously working on 2 hacks (Country Flag and Astrological Sign) and getting errors from one, the other, or both!!!

i tried replacing all the files with default and the same problem persist.

What do you mean by this?? ?? ?? ?? ?? There are NO files to replace. You need to go to the first post in this thread and download the actual hack. Then you need to read and follow the .txt file as it guides you through editing the .php files it needs to work. Then, after EVERYTHING is followed in the .txt file, if you still have problems, let me know. You are posting in both this and the Astrological Sign hack at the same time which you can't be working on both at the same time... get one working first! Then move on to the next hack!

tkhjosh
09-21-2001, 06:54 AM
Originally posted by tkhjosh
i tried replacing all the files with default and the same problem persist.


meaning i uploaded the default .php files example member.php and register.php and ran flag.php again but did not work. :(

AJR
09-21-2001, 07:05 AM
Like I said, if you already ran flag.php, DON'T run it again! The first time you ran it, it added the country field to the user table. Every time you try to run it now, it sees that the country field already exists and will ALWAYS give you an error because it exists. If you made all the changes to the .php files and uploaded them, go to your forum homepage, log in as you, click on the 'User CP' and click on 'Edit Profile'. Look for 'Select your Country' and choose your country from the dropdown list. Submit the modifications and look for one of your posts in the forum. You should see the flag next to your name! Click on your profile and you should see the flag next to your name!

tkhjosh
09-21-2001, 08:03 AM
ok i get the options for selecting country, but it is blank! nothing to choose! i think below is what i dont understand, if possible pls explain.

this is from the readme:

*** The 'modifyprofile_country' template needs to be changed
to a default original templatesetid of -1 (changed templates
have the templatesetid set to 2) or else the Admin CP addon
will not show the country select list (Any ideas why?). To do
this, use phpMyAdmin and run this query:
UPDATE template SET templatesetid="-1" where title="modifyprofile_country"
This will move the template from the custom to default templates
and will be found in the 'User Option Templates' group.

hope to hear from u soon.

AJR
09-21-2001, 08:11 AM
If you have access to phpMyAdmin, go to it and use the following query:

UPDATE template SET templatesetid="-1" where title="modifyprofile_country"

Otherwise, upload the attached tempchange.php file to your admin directory and execute it like you did with flag.php. Then try going to your Edit Profile and see if the list is there.

tkhjosh
09-21-2001, 08:21 AM
nope....sighz...ok

and a problem i cant seem to add the template modifyprofile_country anymore, i tried adding 2 times but its never there, help~

AJR
09-21-2001, 08:50 AM
You can't add a 'modifyprofile_country' template anymore because one already exists! By running the tempchange.php, it changed the template from a "custom" to a "default original" template (-1). You will now find the template in the 'User Option Templates' group. Click on expand and you should see the 'modifyprofile_country' template.

tkhjosh
09-21-2001, 09:09 AM
i see it but i still dont have the scroll bar at the choosing profile
it is completely blank!

Select your Country:
If you select your country, your country flag image will appear next to your name on your posts.

but there is no flags, nothing. yes i did upload the flags to images/flags

there is no scroll bar, pls help!

webhost
09-21-2001, 09:26 AM
tkhjosh

Stop this madness, check your email and your PM'S please

Mark Hewitt
09-21-2001, 09:43 AM
Just to add some contrast here. I've installed the hack and it was flawless. My users love it :D

webhost
09-21-2001, 09:44 AM
Same here.

maverick1236
09-21-2001, 01:44 PM
Great Hack!!

side note:
I see webhost is helping people with their hacks!!!
Hes helped me with a couple in the past-hes real good!!!
Im sure he'll get it workin 4 ya!!!!!

tkhjosh
09-21-2001, 08:47 PM
i just need to fix the scroll bar to choose the flags now. AJR there? :(

tkhjosh
09-21-2001, 10:12 PM
i want to thank AJR & webhost for all thier help, it worked after i installed 1.0 and the problem was with the v2.0 tables. THANKS SO MUCH!!!!!!!!!!!!!!!!!!!!! can u help me with the star signs :P

Delhaze
09-22-2001, 05:55 PM
I have added a new country to the "modifyprofile_country" template, it shows up ok as a user changing profile and for a new user, but is missing from the admin control panel as an admin changing a user or adding a user.

Have I done something wrong?

Update:

It seems the same issue that requires the template to be the default -1 also stops any changes made by using the control panel "edit" being shown afterwards in the admin control panel.

I had to modify the -1 template in phpmyadmin and then "revert to original" to get it to show up.

This kinda defeats the purpose of having it in a template :mad:

AJR
09-23-2001, 05:09 AM
Delhaze... make your changes to the 'modifyprofile_country' template, then execute the attached file. This file will:

- Verify that you have a modified template for 'modifyprofile_country'
- Once verified, it will then delete the original 'modifyprofile_country' template
- Finally it will change the modified template to an original template.

I programmed in the verification because if you DIDN'T modify the 'modifyprofile_country' template, it would delete the original and you'd be left with no template and no country dropdown list! I've checked template_change.php numerous times to make sure it works!

Delhaze
09-23-2001, 10:41 AM
Originally posted by AJR
Delhaze... make your changes to the 'modifyprofile_country' template, then execute the attached file. This file will:

- Verify that you have a modified template for 'modifyprofile_country'
- Once verified, it will then delete the original 'modifyprofile_country' template
- Finally it will change the modified template to an original template.

I programmed in the verification because if you DIDN'T modify the 'modifyprofile_country' template, it would delete the original and you'd be left with no template and no country dropdown list! I've checked template_change.php numerous times to make sure it works!

This wouldn't work for me, my template set id is different so the verification fails.

Kengan
09-23-2001, 10:11 PM
Thanks ! COOL Hack ! I will try it tonight ! ;)

The Realist
10-06-2001, 11:58 AM
In the Install instructions it states the below were it shows up twice.

I can only find it once in my user.php, can anyone help please.

Lost!

Brian

5 - 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");

Trillian
10-07-2001, 03:14 PM
Realist,

Simply paste it after the first time you see it. It is true that the exact syntax of the code appears only once in the script. What the author was implying is that there is a second line in the script that looks very familiar to the first, and was trying to avoid confusion ;)

And to the author, GREAT WORK! My members are having a lot of fun with this hack :)

Delhaze
10-07-2001, 09:02 PM
Originally posted by Trillian
Realist,

Simply paste it after the first time you see it. It is true that the exact syntax of the code appears only once in the script. What the author was implying is that there is a second line in the script that looks very familiar to the first, and was trying to avoid confusion ;)

And to the author, GREAT WORK! My members are having a lot of fun with this hack :)

I dont thing thats correct, the second line that is similar also needs code to be added below it. Read the first page of the thread and it should be clearer.

jamesdasher
10-14-2001, 01:26 AM
Okay, can somebody tell me what I did wrong...I wanted the large flags (provided by webhost) so I downloaded all the files unzipped them into the flags folder (at the same time erasing the original flags)...but...all the different pages are still trying to find the old image and saying 'not found'? Can anybody help?

James

aldamon
10-16-2001, 12:38 PM
Hi,

The hack has been working great, but I thought you should know there's an error in your instructions. The flag for Great Britain, "Great Britain.gif", is referred to as "Great Britan.gif" (without the "I") in your instructions. You might want to change that. The flag obviously won't display without the change.

Thanks!

orca
10-16-2001, 03:13 PM
Hi there,

here's what I did to display the flag in memberlist:

Open memberlist.php and find


if ($userinfo[receivepm]) {
eval("\$userinfo[pmlink] = \"".gettemplate("postbit_sendpm")."\";");
} else {
$userinfo[pmlink] = "&nbsp;";
}


Just below it add


// Country Hack
if (!$userinfo[country]) {
$flag = "&nbsp;";
} else {
$Country=$post[country];
$Countryalt = str_replace("%20"," ",$Country);
$flag = "<img src=\"images/flags/$Country.gif\" alt=\"$Countryalt\" border=\"0\">";
}
// Country Hack End


Now you need to modify memberlist and memberlistbit template.

In the template memberlist you need to increase the colspan of the td tag to 7:


<td bgcolor="{ categorybackcolor }" colspan="7"><normalfont color="{ categoryfontcolor }"><b>$bbtitle Members List</b></normalfont></td>


After you done that, insert


<td bgcolor="{ tableheadbgcolor }" align="center"><smallfont color="{ tableheadtextcolor }"><b>Country Flag</b></smallfont></td>


wherever you like. Be sure the remember where it was since you need to insert it at the same place in memberlistbit. E.g. if you add it after Email you need to put the following


<td bgcolor="{ firstaltcolor }">$flag</td>


just after


<td bgcolor=" { secondaltcolor } ">$userinfo[useremail]</td>


Please omit the spaces around the {} brackets. You may need to change the order of first- and secondaltcolor to get alternating colors.

Alternatively, you could leave memberlist alone and insert only $userinfo[country]. This will display the countries name.

DixonsNL
10-23-2001, 06:20 PM
AJR, Your that man! ;) I got it running, and it works Perfect!! thnx m8! :) Keep the good hacks comming :D

Diva
10-25-2001, 01:53 PM
Hi... I got the hack up and running. I love it! The problem? This guy tried to help with another, replaced my '.php' with the originals and now I can't seem to get the drop down box. I tried replacing all and basically starting over. The people who had flags still have them. I only see a section where the drop down box should be. Any suggestions? I love this hack!

Diva
10-26-2001, 04:21 PM
Yay! It works! I don't know what I did, but I got it working! It looks great. Thanks AJR!

And thanks to Orca for the memberslist add on. It works like a charm!

On to tackle my next hack. :eek:

aldamon
10-30-2001, 06:08 PM
Please please pretty please make sure this works on 2.2.0!!!! I simply will not switch to the new version if my flags won't work!

orca
10-31-2001, 11:10 AM
Actually, I think there's not a big reason why this shouldn't work. You just need to reapply the file and template modifications.

MrLister
10-31-2001, 01:53 PM
hmmm when you reply does it mean it's isntalled..... i didn't click install and it's installed. i mean i did install it but it showed it here automatically or because i put down my last post.

aldamon
11-01-2001, 01:09 PM
This hack is a no go in 2.2.0. Damn it. Could someone suggest some changes? I've tried to tweak it for 2.2.0 with no luck.

aldamon
11-01-2001, 06:57 PM
Well a few tiny changes this hack WILL indeed work with 2.2.0.

Yes!

xug
11-02-2001, 09:41 AM
I Think this is a great hack, but I don't get it to work with my new
v2.2.0
What do I need to change to get it to work ?

Alien
11-02-2001, 01:07 PM
I got this to work with 2.2.0 as well, but wish I saved the changes I had to make.. It wasn't anything difficult though...

Sorry I didn't save the changes. :(

orca
11-02-2001, 01:47 PM
Originally posted by xug
I Think this is a great hack, but I don't get it to work with my new
v2.2.0
What do I need to change to get it to work ?

It works for me with the same changes as on 2.0.3...

aldamon
11-02-2001, 01:58 PM
That's impossible. The code has changed in key sections changed in the hack. Have you actually tried to register or to change your options in the user cp after your "successful" upgrade?

orca
11-02-2001, 02:54 PM
Well, ok, that's true. The dropdown menu is missing for the registration. That may needs a change.

orca
11-02-2001, 03:05 PM
If you update, the template modifyprofile_country is deleted if you ran the query. Just redo the template.
This works, I just did it on my site.

webhost
11-03-2001, 03:01 AM
It worked fine for me without any changes, if you read through this post it states somewhere in here to change it from a custom template to a main template which I did, when I dumped my old database and restored template followed.

orca
11-03-2001, 07:19 AM
I had it also as custom template...it was removed anyway after running the update script.

Mark Hewitt
11-03-2001, 02:51 PM
I've just reinstalled it in 2.2.0, no problems at all. And no template changes required! :D

xug
11-04-2001, 09:32 PM
When you have looked well why you was copying and pasting some of this great hack in vb2.2.0 you would have seen that there are now some functions that will not work properly.

Old hack text :
// Country Hack Replace
// $DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage ,icq,aim,yahoo,signature,adminemail,showemail,invi sible,usertitle,joindate,cooki euser,daysprune,lastvisit,lastactivity,usergroupid ,timezoneoffset,emailnotificat ion,receivepm,emailonpm,options,birthday,maxposts, startofweek,ipaddress,pmpopup, referrerid,nosessionhash) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes($password)."', '".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspe cialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepag e))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($ aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."' ,'$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time(). "','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newuse rgroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$ emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."',' ".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslas hes($testreferrerid['userid'])."','$nosessionhash')");
$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage ,icq,aim,yahoo,signature,adminemail,showemail,invi sible,usertitle,joindate,cooki euser,daysprune,lastvisit,lastactivity,usergroupid ,timezoneoffset,emailnotificat ion,receivepm,emailonpm,options,birthday,maxposts, startofweek,ipaddress,pmpopup, referrerid,nosessionhash,country) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes($password)."', '".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspe cialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepag e))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($ aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."' ,'$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time(). "','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newuse rgroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$ emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."',' ".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslas hes($testreferrerid['userid'])."','$nosessionhash','".addslashes($country)."')");
// Country Hack End

Must be :
// Country Hack Replace
// $DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage ,icq,aim,yahoo,signature,adminemail,showemail,invi sible,usertitle,joindate,cooki euser,daysprune,lastvisit,lastactivity,usergroupid ,timezoneoffset,emailnotificat ion,receivepm,emailonpm,options,birthday,maxposts, startofweek,ipaddress,pmpopup, referrerid,nosessionhash,avatarid) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes($password)."', '".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspe cialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepag e))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($ aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."' ,'$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time(). "','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newuse rgroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$ emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."',' ".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslas hes($testreferrerid['userid'])."','$nosessionhash','$avatarid')");
$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage ,icq,aim,yahoo,signature,adminemail,showemail,invi sible,usertitle,joindate,cooki euser,daysprune,lastvisit,lastactivity,usergroupid ,timezoneoffset,emailnotificat ion,receivepm,emailonpm,options,birthday,maxposts, startofweek,ipaddress,pmpopup, referrerid,nosessionhash,avatarid,country) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes($password)."', '".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspe cialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepag e))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($ aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."' ,'$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time(). "','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newuse rgroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$ emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."',' ".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslas hes($testreferrerid['userid'])."','$nosessionhash','$avatarid','".addslashes($country)."')");
// Country Hack End

At the end off both lines the '$avatarid' needs to be inserted in the script for vb2.2.0, because when you have copied this part from the vb2.0.3 hack version it's not available

This was just what i found in a flash and maybe there are more things that needs to be adjusted !!

My $0.02

Logtenberg
11-07-2001, 11:10 PM
When trying to view a members profile I get this error (Just installed flag hack)

Database error in vBulletin: Invalid SQL: UPDATE user SET profileviews=profileviews+1 WHERE userid=4196
mysql error: Unknown column 'profileviews' in 'field list'
mysql error number: 1054
Date: Wednesday 07th of November 2001 07:59:46 PM
Script: /forum/member.php?s=&action=getinfo&userid=4196
Referer: http://66.78.40.13/forum/showthread.php?threadid=441&goto=nextnewest

Anyone know the problem?

Also - I noticed that when I edited the required files and saved them, the size of the files would always increase be 2 or more kilobytes. Where did this extra size come from? (I am using windows 2000 and am editing the files in wordpad)

webhost
11-07-2001, 11:16 PM
looks like u need to add a field to the user table

Logtenberg
11-07-2001, 11:17 PM
What field would that be? did I miss a step?

webhost
11-07-2001, 11:23 PM
Unknown column 'profileviews' in 'field list'

place that profileviews has a new field in your user table, should say smth in the instructions

xug
11-12-2001, 03:12 AM
Is this hack working on V2.2.0 or not ?????

webhost
11-12-2001, 08:40 AM
yes

xug
11-12-2001, 10:55 AM
When I go to step 3 of the installation :

3 - Open showthread.php (or admin/functions.php for v2.0.3)

find:
$post[joindate]=vbdate($registereddateformat,$post[joindate]);

Just above add:
// Country Hack
if (!$post[country]) {
$flag = "";
} else {
$Country=$post[country];
$Countryalt = str_replace("%20"," ",$Country);
$flag = "<img src=\"images/flags/$Country.gif\" alt=\"$Countryalt\" border=\"0\">";
}
// Country Hack End

----------

I can't find the line that I need to search for !!!!!!
I work with VB2.2.0
Please HELP!

webhost
11-12-2001, 11:00 AM
put it right under this


$jointime = (time() - $post[joindate]) / 86400; // Days Joined
if ($jointime < 1) { // User has been a member for less than one day.
$postsperday = "$post[posts]";
} else {
$postsperday = sprintf("%.2f",($post[posts] / $jointime));
}

xug
11-12-2001, 11:27 PM
I have done everything what is written in this thread and got only errors.

I uninstalled it and hope that there will be an new update version soon in this forum.

webhost
11-13-2001, 12:43 AM
xug

I sent you a pm, Send your php files to me for this and I will fix them for you. E-mail address in the pm.

xug
11-13-2001, 12:50 AM
I sended a reply !
Thanks for all the help !

Matt
11-17-2001, 03:04 AM
I installed :) Problem is it shows up in the profile fine but nothing shows up where I put $flag in my postbit template :(

Any ideas why not?

over
11-17-2001, 03:36 PM
has anyone tried this hack for 2.2.1 ? or is it just me that can't find a couple parts in the files to modify?

Bane
11-23-2001, 07:56 AM
Could try this I guess, I tried to do the changes when I installed on 2.2.1, I also corrected the horrible maiming of my name (Bain?) in the docs :p Lemme know how it turns out for the 2.2.1 users, this is a quick change so sorry, just put it together for a friend doing an install.


NOTE:
In the docs you will notice the following for every file edit::
FIND:
error_reporting(7);

BELOW this ADD:
/* Hacks Added to this File
##############################
[vB v2.2.0] Country Flag Hack v2.0 (X) [Date]
############################## */

This is NOT NEEDED. It is something that I do to better track the changes that I made to each file, where X = the number of changes I made to the file, and Date = the date I did it, so I can see quickly if my version is the latest. This is not in anyway necessary but my mate is about as scatterbrained as I am about these things so I included it for him.

Good luck all.

over
11-23-2001, 10:13 AM
ta for the update :) installin the now :)

ariaforums
11-23-2001, 12:12 PM
$post[joindate]=vbdate($registereddateformat,$post[joindate]);

I still cannot find this in adminfunctions.php :(

Bane
11-23-2001, 12:18 PM
Originally posted by ariaforums
$post[joindate]=vbdate($registereddateformat,$post[joindate]);

I still cannot find this in adminfunctions.php :(

Try looking for it without spaces $post[joindate]=vbdate($registereddateformat,$post[joindate]);

If that doesn't work try looking for } else {
$postsperday = sprintf("%.2f",($post[posts] / $jointime));
} its just below that.

Lesane
11-24-2001, 11:21 AM
Originally posted by AJR
Version 2.0 - September 6, 2001
================================================== ==
This is the second release of the Country Hack. I have
converted it to make it work with Bain's vBStats hack
that will be released sometime in the near future. Bain
and I have been working together because both the Country
Hack and vBStats Hack require all the flags. We didn't
want you to have to have double images with different
names (which would mean over 450 files in the flags
directory!)

By changing the flag names from their country code to
their country name, it is now possible to have the ALT
tag show the name of the country when you put your mouse
pointer over the flag image.

Changes from v1.0:
- Images have been changed from country codes to country names


Loox like a great hack but i dont understand one thingy that you said above. You said:
We didn't want you to have to have double images with different names (which would mean over 450 files in the flags
directory!)

But the flags of the vbstats hack of bane have country codes and you use the country names :confused:
So we have now double images with different names or do i c this wrong? :confused:

Bane
11-24-2001, 04:49 PM
The problem was that in the original version of the flags hack there were all lowercase flag names etc.. then these. Orignally the same system as is used here was used for vbstats however vbstats ended up being a little too popular so for language abstraction purposes I decided to make the switch to country codes. (Now its much easier to change the country names for other language users of vbstats) There is an easy way to change the image settings for flags in vbstats if you want to use the same set. Or optionally you can wait for the next release of vbstats where I will release a compatible Flag Hack if AJ isnt back yet.

Lesane
11-25-2001, 07:11 AM
Okey, that makes things clear. Do you know already the deadline of the next Vbstats release?

aldamon
11-28-2001, 12:11 PM
nm

xug
11-28-2001, 03:58 PM
I got it finally working, thanks to all who did a great job here !

xug
11-28-2001, 07:56 PM
I thought that everything was working, but there is a little bug.

When people want to sign up and they fill up all the required information right and submit it, it will give an error message that they have to check again because something wasn't filled up right.

I did it myself also a few times and for sure I did what was required but gave me the error too.

When I installed this hack I did every file step by step and uploaded it back to my site, checked if there where no errors and all looked ok.

So I think there must be something wrong with the last file, register.php

Can please somebody advise me what this could be.

Thank you.

nighteyes
11-29-2001, 04:37 PM
Yes, you got it in one. The error is in register.php, I had the same problem. Just download the updated instructions for the 2.2.1 sourcecode a few messages up kindly put together by a generous soul. Extract the original register.php from the ZIP (if needed) and then apply the instructions in step 4 all over again... upload and it *should* work. It did for me.

aldamon
11-29-2001, 04:54 PM
There are actually 3 updated sections for 2.2.1. I noticed in my previous text file that I used two different phrases to indicate changes, *** Updated for vB 2.2.1 *** AND *** Modified for vB2.2.1 ***. I just changed the text file so all 3 changes are marked by:

*** Modified for vb 2.2.1 ***

Here it is again and remember there are 3 changes. I have fully updated the affected sections with the 2.2.1 source code.

Enjoy!

trilOByte
12-05-2001, 07:23 AM
Great hack, works fine on 2.20 once I had modded the register.php as mentioned.

One small issue - you don't have my country :mad: :

England.

trilOByte
12-05-2001, 07:24 AM
Oh yeah, here's Wales too ;)

Lionel
12-19-2001, 09:32 AM
Great hack! I installed it one shot on 2.21.

Stretchr
01-15-2002, 01:39 AM
Bane,
I would very much like the hack to use the same flags for vbStats if you mean that vbStats can use the flags with the full country name. That would be great, even if I would have to upload these, I prefer having the alt tag capability. Think I'll wait till I get a reply to this before installing but it's a great hack. Thanks!

Originally posted by Bane
The problem was that in the original version of the flags hack there were all lowercase flag names etc..There is an easy way to change the image settings for flags in vbstats if you want to use the same set. Or optionally you can wait for the next release of vbstats where I will release a compatible Flag Hack if AJ isnt back yet.

Stretchr
01-15-2002, 05:51 AM
I'd still like to hear from Bane regarding integrating with vbStats but I couldn't wait to install this one. Great job on the hack and documentation.

I'm running 2.2.1 and did your step-by-step and it went flawlessly. Guess it pays to RTFM, though I'd hate to make a habit of it. :D Thank you AJR!

Erwin
01-15-2002, 07:06 AM
Wow... I had to do a small bit of modifications to the hack to make it comply with the mood hack, gender hack and and all my other user hacks - I was getting database errors, and had to sort it out. Took a while, no one was able to register or change their profile, but I persevered, and it is now working. I made it non-compulsory when a new user registers too. I could not be bothered making any changes to the vbstats flags, so I just uploaded the long name ones.

Good job! :)

Now to try to get it working from CP...

Erwin
01-15-2002, 07:11 AM
Yup, CP is working.

Whew... :)

And the addition to the memberlist was sweet too. Thanks!

Dex
01-21-2002, 12:59 AM
Thanks for the great hack :)

Dex

Dex
01-21-2002, 07:14 AM
Bane it'd be great if you'd take off that faulty version of yours or at least replace it with aldamon's updated version.

Your text file had me busy for 2 hrs figuring out why people couldn't register. And that's right after I told people that my site is online. They all got knocked back, pretty embarrassing.

It's the missing 'country' string in the register.php.

I guess I didn't really understand aldamon, I thought he had just a version that indicated all the changes from 2.0.3 to 2.2.1 or something like that, which I didn't need. That's why I DL the original file.

Just trying to save other newbies from this experience.

;)

Dex

aliraqi
01-21-2002, 08:42 AM
why hasnt webhost replied to the fact that the string he said is found twice in usercp.php only occurs in it once?

what are we supposed to do?

PhotoGenie
02-02-2002, 08:01 PM
I installed this hack on 2.2.2 and the flags show fine. I had trouble with not being able to register after making changes to the register.php .. I decided to leave the register changes out and everything else is working fine. You can add flags in your edit profile still. I was getting a parse error on the very last line of the register.php file. It could have been my error because I didn't try it again, but I do plan too. This is a great hack and I'll take it anyway I can get it. Thanks!

KISS
02-02-2002, 08:26 PM
does this work and and avatars together? or it replaces the avatars?

PhotoGenie
02-02-2002, 08:56 PM
With avatars:)

PhotoGenie
02-02-2002, 09:54 PM
I went back and made the changes in my register.php file again and apparently I made a mistake changing the code.. This hack is completly compatible with 2.2.2.. I have tested it thouroughly.

KISS
02-03-2002, 12:46 AM
ok cool gonna install this then hehe :)

TheComputerGuy
02-04-2002, 03:14 AM
I have this installed for 2.21, it works great for new people, but me, I can not edit my flag and it show......any idea.....Thanks for a great hack

PhotoGenie
02-04-2002, 10:55 AM
Have you looked at your user table in phpMyAdmin in the country field to see if its adding it to the database?

TheComputerGuy
02-04-2002, 12:57 PM
I edited it in the admin CP and it started to work...but the flag is not, so the images arent quite yet but I think it is workign )

TheComputerGuy
02-04-2002, 12:57 PM
thanks for the help :)

khan
02-10-2002, 01:22 PM
I got an error :surprised
Parse error: parse error in /home/virtual/site35/fst/var/www/html/vportal/forums/member.php on line 528

anybody know what that means
and btw I have 2.2.2
oh yea forgot when I go to user control panel and go to edit profile, edit options or edit password

X-Fan
02-11-2002, 01:40 AM
How would one get the country flags to appear on the memberlist.php page?

I know that would require code added to the memberlist.php file as well as modfying the memberlist templates, but I'm not sure what would need adding to memberlist.php.

X-Fan
02-11-2002, 01:55 AM
Hey all,

This hack has proven so popular on my forums that I've done my own update to it to include ever-so-slightly larger-sized flags, updates to several flags from the original release (like Rwanda, whose flag changed on December 31, 2001, Martinique, Reunion, Tuvalu, etc), and to include several flags that weren't in the original, such as the British countries (England, Ireland, Wales, Scotland, Isle of Man, Channel Islands, etc), countries in dispute (like Northern Cyprus, Tibet, French Guiana, etc), and more.

All it takes is an upload of the new flag image files as well as a modification to the modifyprofile_country template. I've attached a text file containing the mods to this post and will attach two zips with the new flag images to my next two posts.

Hope y'all like it!

X-Fan
02-11-2002, 02:00 AM
Here's the first zip (74k) containing the updated flags for 2002 from A-M.

X-Fan
02-11-2002, 02:01 AM
And here's the second zip (54k) containing the updated flags for 2002 from N-Z!

X-Fan
02-12-2002, 07:52 AM
Bump...

Massiel
02-16-2002, 09:20 AM
I want to add this hack for my flags, use the avatar for photos and the medals for medals, is this possible? Thanks in advance! I am also wanting to add the star hack. Any known complications?

X-Fan
02-16-2002, 09:33 AM
Originally posted by Massiel
I want to add this hack for my flags, use the avatar for photos and the medals for medals, is this possible? Thanks in advance! I am also wanting to add the star hack. Any known complications?

I'm using the flags hack, the medals hack, and avatars without a hitch.

Massiel
02-16-2002, 11:50 PM
How do I run a query? I am new at this, was ready to install hack and got stuck here...

================================================== ==

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

================================================== ==

aldamon
03-07-2002, 12:17 PM
Works with 2.2.3! Updated instructions attached!

freehtml
03-10-2002, 02:30 AM
can we had the flag name be reflected in text format so that if I select SIngapore flag..

It will display the GIF file as well as display "Country : Singapore" ?

freehtml
03-10-2002, 02:31 AM
Originally posted by X-Fan
How would one get the country flags to appear on the memberlist.php page?

I know that would require code added to the memberlist.php file as well as modfying the memberlist templates, but I'm not sure what would need adding to memberlist.php.

What about include also in the "forum leader" list?

AJR
03-11-2002, 10:35 AM
Hey all... I have updated the Country Flag Hack to v2.1. This version should work with all 2.2.x versions. See other additions and download v2.1 in the first post of this thread.

Erwin
03-11-2002, 05:15 PM
Updated! Thanks!

freehtml
03-12-2002, 01:44 AM
somehow it appears under my profile and all that but not in the Member list... I am using vB 2.2.4

Lucky
03-12-2002, 05:15 AM
Great work my friend!!!

Dez_U
03-14-2002, 09:43 AM
I am using version 2.2.4 and it works great for NEW MEMBERS ONLY. ??

A new member can register and the flag will show

Exsisting members can see the drop down in their user cp and select their country flag. but it does not show ??

Also none of the flags show on the members list.

Any help, thanks

PS, very <--COOL--> hack :D

Erwin
03-14-2002, 10:06 PM
Make the modifyprofile_country template default by making it (-1) using phpmyadmin as per the instructions.

Dez_U
03-14-2002, 10:19 PM
sorry newbe here .... how do I do that then ??

I am in the phpMyAdmin area, what do I do next ?

Dez_U
03-14-2002, 10:49 PM
OK, I followed the instructions :) and did the search and changed the template to -1

BUT it still don't work for oldtimers on the board. Is it something to do with 2.2.4 ??

Dez_U
03-15-2002, 09:59 PM
does anyone have an answer to this as its driving my members nuts :)

Hamsh
03-17-2002, 01:15 AM
Most of it works fine on my 2.2.4, will display flags for old members no problems.

Whenever I try to logout or view a member profile I get a parse error in member.php, line 500 and something. Everything seems to be replaced and added OK, and I thought I'd followed all instructions. I don't have access to anything other than notepad to count the lines. Before I count them all on the screen, anyone got any ideas on what might be causing this?

freehtml
03-17-2002, 02:13 PM
Originally posted by Hamsh
I don't have access to anything other than notepad to count the lines.

Try using NoteTab (http://www.notetab.com) ,a well good replacement for Notepad.

Dez_U
03-17-2002, 03:20 PM
so does anyone have any suggestions as to how i can get this cool hack working 100% ?

Demascus
04-21-2002, 02:51 PM
anyone got this working on vbb2.2.5 yet?

Chris M
04-21-2002, 04:22 PM
I noticed a syntax error...

4 - Open member.php

find:
$templatesused .= "register_birthday,modifyprofile_customtext,registe r_customfields,usercpnav,modifyprofile";

Should be :

4 - Open member.php

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

Satan

Chris M
04-21-2002, 04:23 PM
Another one :

// Country Hack Replace
// $templatesused .= "register_birthday,modifyprofile_customtext,registe r_customfields,usercpnav,modifyprofile";
$templatesused .= "register_birthday,modifyprofile_customtext,modifyp rofile_country,register_customfields,usercpnav,mod ifyprofile";
// Country Hack End

Should be :

// Country Hack Replace
// $templatesused = 'register_birthday,modifyprofile_customtext,regist er_customfields,usercpnav,modifyprofile';
$templatesused = 'register_birthday,modifyprofile_customtext,modify profile_country,register_customfields,usercpnav,mo difyprofile';
// Country Hack End

Satan

Chris M
04-21-2002, 04:25 PM
eval("\$customtext.= \"".gettemplate("modifyprofile_customtext")."\";");
}
}

Should be :

eval("\$customtext = \"".gettemplate("modifyprofile_customtext")."\";");
}
}

Chris M
04-21-2002, 04:48 PM
I think that is all the syntax errors there were...

Satan

Erwin
04-21-2002, 11:28 PM
Defnitely works on 2.2.5.

aldamon
04-22-2002, 11:30 AM
I'm going to miss this in vb3.0. I hope it is ported!

mashby
04-22-2002, 03:45 PM
Just wanted to let you know that I followed your directions to a "T" and your hack installed just as described. Although the instructions were lengthy, the result was on the money. :cool:

Thanks for making such a GREAT hack!

212rikanmofo
04-25-2002, 02:43 AM
the hack works great, but one thing thats not working is the user registering part, when a user submits, it keeps saying please filled all required fields, and ALL fields are filled out... i think it has to do with the registrationadult template, but the dropdown menu where you select your country doesnt even show up at all under the registration form, under enter your email...

here's what part of my registrationadult template looks like:

<td bgcolor="{secondaltcolor}"><normalfont><b>Email:</b></normalfont><br>
<smallfont>Please enter a valid email address. You can choose to hide it below in the preferences section.</smallfont></td>
<td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="email" size="25" maxlength="50"></normalfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Enter Email Again:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="emailconfirm" size="25" maxlength="50"></normalfont></td>
</tr>
<!-- Country Hack Code Begin -->
<tr>
<td bgcolor={firstaltcolor}><normalfont><b>Select your Country:</b></normalfont><br>
<smallfont>If you select your country, your country flag image will appear next to your name on your posts.</smallfont></td>
<td bgcolor={firstaltcolor}><smallfont>
$countrytext</td>
</tr>
<!-- Country Hack Code End -->
$customfields_required
<!-- *** -->
<tr>
<td bgcolor="{tableheadbgcolor}" colspan="2"><normalfont color="{tableheadtextcolor}" class="thtcolor"><b>Optional Information</b></normalfont>


why isn't it showing up at all? any reasons, other than that, the hack works great, but i need to fix this, cause it wont let users register cause it keeps saying please fill in all fields, thats cause the dropdown menu for the country isnt even available to them...

mashby
04-25-2002, 06:17 AM
Well, I spoke too soon as well. I ran into a similar problem. I'm in the process of removing the hack so that I can get my registeration back. Everything worked, but I got a SQL error everytime someone tried to register.

UPDATE:
Well, after un-installing the hack the error is still there. So, I'm going to have to take more drastic measures to get my board back to 100%. FYI, this is the SQL Error I'm getting.

Database error in vBulletin 2.2.5:

Invalid SQL: INSERT INTO userfield (userid,field5,field6,field7,field1,field2,field3, field4) VALUES (,'Demo
Account','Demo','Demo','','','','')
mysql error: You have an error in your SQL syntax near ''Demo Account','Demo','Demo','','','','')' at line 1

mysql error number: 1064

Date: Thursday 25th of April 2002 02:22:37 AM
Script: http://www.interpug.com/private/forum/private/forum/register.php
Referer: http://www.interpug.com/private/forum/register.php

mashby
04-25-2002, 06:47 AM
I downloaded a fresh copy of vBulletin 2.2.5 and uploaded a clean copy of register.php and everything is back to normal. So, obviously something is up with the register.php changes. Too many people are complaining about it to be a fluke, or a typo on the installer's part.

If the register.php worked properly, it would be a GREAT hack.

Does anyone know if I can install everything BUT the register.php changes? I don't really care to make the user choose their flag when they join.

212rikanmofo
04-30-2002, 04:17 AM
mashby, i also need a fix for this

something is wrong with the register.php

when i have the hack, when a user registers, there is no drop down box where they can choose there country, it wont show up at all. and therefore they cant register since it's a required field, so i had to take it out, but the rest of the hack works great. just that one fault, is there a fix for this please?

mashby
04-30-2002, 04:23 AM
My error was that the register just didn't work. Everything appeared ok, but register.php just didn't work.

Since my problem was a little different. I would check through the code that you have to alter in your templates and in register.php again. It sounds like you may just be missing something in the template you have to create.

212rikanmofo
04-30-2002, 04:28 AM
i checked the template so many times, and thats not the problem
... i dont know why its not showing up at all when a user registers

Erwin
04-30-2002, 05:05 AM
Make sure you've made the template -1 so that it's default. This hack is temperamental like that. Also make sure that you database inserts in register.php includes the country variable as well.

Erwin
04-30-2002, 05:13 AM
Remember, each time you upgrade vB, you need to run the database query again to make that country select list template -1 again. This is the only hack that I know of that requires this.

212rikanmofo
04-30-2002, 06:34 AM
i already ran that -1 query already, and what do you mean include register.php? im not understanding, do i have to include it in a template? clarify this for me please...

scsa20
05-02-2002, 05:49 PM
I keep getting this:

Database error in vBulletin 2.2.5:

Invalid SQL: SELECT country FROM user WHERE userid=1
mysql error: Unknown column 'country' in 'field list'

mysql error number: 1054

Date: Thursday 02nd of May 2002 02:36:08 PM
Script: http://forums.simon-soft.com/member.php?action=editprofile
Referer: http://forums.simon-soft.com/usercp.php?


how do I fix this??

wot-Mike
05-02-2002, 06:45 PM
Looks like you didn't run a querie. The user table needs to be altered, the country field needs to be added.

Look inside the install.txt for that info :)
It's step 1 I believe...

scsa20
05-02-2002, 07:18 PM
doh, stupid me, all I look for is the code to put in, plus the beging part of the install.txt file is nothing but info about it...maybe I should open up my eyes more :rolleyes:

Sketch
05-02-2002, 10:31 PM
okay, all is hitchless for me except one thing. In the memberlist, the flag is not displayed. Everywhere else it is displayed okay.

Here is a link to where it is not showing---http://www.livetheworship.com/vb/memberlist.php?s=

Here is a link to where it is showing---
http://www.livetheworship.com/vb/showthread.php?s=&threadid=89

Here is my memberlistbit (fragment):
<tr align="center">
<td bgcolor="{firstaltcolor}">$flag</td>
<td bgcolor="{secondaltcolor}" align="left">
<span style="font-size: 11px;">
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userinfo[userid]">$userinfo[username]</a>
</td>


Any ideas why it won't show up here?

Sketch

scsa20
05-03-2002, 02:34 AM
did you add $flag ??

DWZ
05-03-2002, 09:39 AM
Can someone tell me how I can make it so a users must select a flag when they sign up?

ie. You get a message saying "You must select a country to register" if they keep the box blank.

Thanks :)

DWZ
05-07-2002, 01:19 AM
Originally posted by DWZ
Can someone tell me how I can make it so a users must select a flag when they sign up?

ie. You get a message saying "You must select a country to register" if they keep the box blank.

Thanks :) http://members.optushome.com.au/megabaz3/forums/BUMP.gif

DWZ
05-12-2002, 11:26 PM
awww... come on, please, anyone?

DWZ
05-18-2002, 11:52 AM
Originally posted by DWZ
awww... come on, please, anyone? it isn't that hard... is it?

webhost
05-18-2002, 04:24 PM
In register.php find this



if ($action=="register") {

if (!$allowregistration) {

eval("standarderror(\"".gettemplate("error_noregister")."\");");

exit;

}



if ($bbuserinfo[userid]!=0 and !$allowmultiregs) {

$getuser=$DB_site->query_first("SELECT username FROM user WHERE userid='$bbuserinfo[userid]'");

$username=$getuser[username];



eval("standarderror(\"".gettemplate("error_alreadyregistered")."\");");



exit;

}




After it put this




" if($country==""){
eval("standarderror('Please select your country.');");
exit;
}"

DWZ
05-18-2002, 09:25 PM
Originally posted by webhost
In register.php find this



if ($action=="register") {

if (!$allowregistration) {

eval("standarderror(\"".gettemplate("error_noregister")."\");");

exit;

}



if ($bbuserinfo[userid]!=0 and !$allowmultiregs) {

$getuser=$DB_site->query_first("SELECT username FROM user WHERE userid='$bbuserinfo[userid]'");

$username=$getuser[username];



eval("standarderror(\"".gettemplate("error_alreadyregistered")."\");");



exit;

}




After it put this




" if($country==""){
eval("standarderror('Please select your country.');");
exit;
}"


Great :D

Thanks for that :)

But just to check, should those " at the start and end be there in the code I'm puting in be there?

webhost
05-18-2002, 09:33 PM
if($country==""){
eval("standarderror('Please select your country.');");
exit;
}

DWZ
05-18-2002, 11:59 PM
Originally posted by webhost

if($country==""){
eval("standarderror('Please select your country.');");
exit;
}
yep, thats what I thought :)

Will test it now

DWZ
05-19-2002, 12:05 AM
OK, just tried it, didn't work :(

As soon as I hit the register link, it says "Please select your country."

I hadn't even got to the signup page yet before it said it...

Any ideas?

webhost
05-19-2002, 01:28 AM
remove that and place here.

Find

// Country Hack

$country = trim($country);
// Country Hack End



and place this after it


if($country==""){
eval("standarderror('Please select your country.');");
exit;
}



so it should like this when finished


// Country Hack

$country = trim($country);
if($country==""){
eval("standarderror('Please select your country.');");
exit;
}
// Country Hack End

DWZ
05-19-2002, 01:41 AM
That worked great :D

Thanks for all your help webhost.

refertech
06-03-2002, 01:49 AM
Great work man. I would it be possible to see the country name in the users profile. I dont reconize alot of the flags.
Installed great for me in 2.2.6. :)

aldamon
06-07-2002, 02:31 PM
I'm so attached to this hack that I probably won't upgrade to vB 3.0 until it is ported.

freehtml
06-08-2002, 01:24 PM
I can't seems to find find:
$templatesused .= "register_birthday,modifyprofile_customtext,registe r_customfields,usercpnav,modi fyprofile";

In my member.php (version 2.2.6)...

ciscoman
07-07-2002, 09:22 PM
It should be this
$templatesused = 'register_birthday,modifyprofile_customtext,regist er_customfields,usercpnav,modi fyprofile';

freehtml
07-14-2002, 12:35 AM
thanks, I think I will not install any hack till vB 3 is out

MarkG
07-16-2002, 06:05 PM
great hack

two errors: europe flag is not there(but it's here http://apolyton.net/forums/images/flags/Europe.gif) and Tajikistan.gif is mispelled

streamzone
07-26-2002, 11:16 PM
k...

Hack works wonderfully - EXCEPT. It displays the flag everywhere it's supposed to except under or next to my members name when showing threads. I've checked and rechecked the code so many times in postbit template... everything looks fine. Any idea what the problem could be? Thanks in advance.

Jean147
08-09-2002, 01:10 AM
Originally posted by streamzone
k...

Hack works wonderfully - EXCEPT. It displays the flag everywhere it's supposed to except under or next to my members name when showing threads. I've checked and rechecked the code so many times in postbit template... everything looks fine. Any idea what the problem could be? Thanks in advance.

same problem for me here. :( Hack works great in memberlistbit and getinfo. But the flag is not shwon in the postbit template, although $flag is in.

Any help would be really apreciated. :)

Congrats on this hack. It is really great. Just fix the problem please. :p :D

Jean147
08-09-2002, 01:29 AM
The user.php code also does not work. I really tried everything :(

Parse error: parse error in /homepages/15/d42020741/htdocs/gtn/forums/admin/user.php on line 391

ExAvIoUr
08-09-2002, 09:10 PM
1 - Add to database-Table user, field named: country
properties: ( country varchar(50) NOT NULL )

i don't get that.

does it mean that the name is Table and the field is country?

Erwin
08-10-2002, 12:06 AM
No, the table name is "User" - add a field called "Country" with those variables using phpmyadmin.

ExAvIoUr
08-10-2002, 12:10 AM
how do i do that in phpmyadmin?

Erwin
08-10-2002, 12:20 AM
In the query box, run this:

ALTER TABLE user ADD country VARCHAR (50) NOT NULL

Jean147
08-10-2002, 11:59 AM
maybe somone may help me too with my problem?

carpman
08-23-2002, 12:38 PM
i can get this to work for admin but registered users just see blank space where country list/menu should be!!

note this is only in user cp, is ok when they register!!

any ideas

carpman
08-24-2002, 05:43 PM
ok i have a problem in user.php, it says to add:

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

But i already have user away hack installed which changed this entry to:

$DB_site->query("UPDATE user SET away='$away',awaydate=$awaydate,returndate='$retur ndate',awayreason='".addslashe s(htmlspecialchars($awayreason))."',birthday='$birthday',options='$options',user groupid='$usergroupid',username='".addslashes(htmlspecialchars($ausername))."'$p wdinclude,email='".addslashes(htmlspecialchars($email))."',styleid='$userstyleid ',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser=$coppau ser,homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htm lspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".ad dslashes(htmlspecialchars($yahoo))."',signature='".addslashes($signature)."',adm inemail=$adminemail,showemail=$showemail,invisible =$invisible,usertitle='".addsl ashes($usertitle)."',customtitle=$customtitle,joindate=$joindate,cook ieuser=$coo kieuser,nosessionhash=$nosessionhash,daysprune='$d aysprune',lastvisit=$lastvisit ,lastactivity=$lastactivity,lastpost=$lastpost,pos ts='$posts',timezoneoffset='$t imezoneoffset',emailnotification=$emailnotificatio n,receivepm='$receivepm',email onpm='$emailonpm',ipaddress='".addslashes($aipaddress)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");

i have looked but am unclear as to changes i should make?

anyone help?

carpman
08-24-2002, 07:01 PM
i am going to try this, any feedback?

$DB_site->query("UPDATE user SET away='$away',awaydate=$awaydate,returndate='$retur ndate',awayreason='".addslashe s(htmlspecialchars($awayreason))."',birthday='".addslashes($birthday)."',options ='$options',usertitle='".addslashes($customtext)."',usergroupid='$bbuserinfo[usergroupid]',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".ad dslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".adds lashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addsl ashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq)). "',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialc hars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,s howemail=$showemail,invisible=$invisible,usertitle ='".addslashes($usertitle)."', customtitle='".intval($customtitle)."',country='".addslashes($country)."',joinda te=$joindate,cookieuser=$cookieuser,nosessionhash= $nosessionhash,daysprune='$day sprune',lastvisit=$lastvisit,lastactivity=$lastact ivity,lastpost=$lastpost,posts ='$posts',timezoneoffset='$timezoneoffset',emailno tification=$emailnotification, receivepm='$receivepm',emailonpm='$emailonpm',ipad dress='".addslashes($aipaddres s)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid='$bbuserinfo[userid]'");

carpman
08-24-2002, 07:51 PM
hello, modifyprofile_country tempate is set to -1 but users still cannot see the drop down list of coutries in their user-cp, they can when they register though

the code should be ok as when logged in as admin i can see and change country from user-cp

could use some help, only thing not sure of is user.php editing see above posts

carpman
08-26-2002, 09:12 PM
hello, back again.

I have been through re-install of hack, except database entries as not sure if i should duplicate them.

I have done all php pages and tempates and have run the change_template.php, checked with myphadmin and it is set to -1

New users can register with flag and is displays everwhere it should.

However, older user and current users (withflag) cannot access country list via user_cp, it is just blank space.

The other problem is in admin cp, when i try and edit a user the user ID 1 (admin) gets set to the user details (name, profile etc) of who i was trying edit, so i end with two users with same name but different ID.

The the only thing i can think of is a conflick with 'leave away message' which also has changes to entries $DB_site->query("UPDATE user SET

the two pages affected are member.php and user.php below is what i have for each page, i have tried to compare and get things as should be, but might have missed something.

help really appreciated

member.php
$DB_site->query("UPDATE user SET birthday='".addslashes($birthday)."',signature='".addslashes($signature)."',cust omtitle='".intval($customtitle)."',usertitle='".addslashes($customtext)."',email ='".addslashes(htmlspecialchars($email))."',parentemail='".addslashes(htmlspecia lchars($parentemail))."',coppauser='$coppauser',homepage='".addslashes(htmlspeci alchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addsl ashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))." ',usergroupid='$bbuserinfo[usergroupid]',country='".addslashes($country)."' $awaysql WHERE userid='$bbuserinfo[userid]'");

admin/user.php
$DB_site->query("UPDATE user SET away='$away',awaydate=$awaydate,returndate='$retur ndate',awayreason='".addslashe s(htmlspecialchars($awayreason))."',birthday='".addslashes($birthday)."',options ='$options',usertitle='".addslashes($customtext)."',usergroupid='$bbuserinfo[usergroupid]',username='".addslashes(htmlspecialchars($ausername))."'$pwdinclude,email='".ad dslashes(htmlspecialchars($email))."',styleid='$userstyleid',parentemail='".adds lashes(htmlspecialchars($parentemail))."',coppauser=$coppauser,homepage='".addsl ashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq)). "',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialc hars($yahoo))."',signature='".addslashes($signature)."',adminemail=$adminemail,s howemail=$showemail,invisible=$invisible,usertitle ='".addslashes($usertitle)."', customtitle='".intval($customtitle)."',country='".addslashes($country)."',joinda te=$joindate,cookieuser=$cookieuser,nosessionhash= $nosessionhash,daysprune='$day sprune',lastvisit=$lastvisit,lastactivity=$lastact ivity,lastpost=$lastpost,posts ='$posts',timezoneoffset='$timezoneoffset',emailno tification=$emailnotification, receivepm='$receivepm',emailonpm='$emailonpm',ipad dress='".addslashes($aipaddres s)."',pmpopup=IF(pmpopup=2 AND $pmpopup=1,pmpopup,'$pmpopup') WHERE userid='$bbuserinfo[userid]'");

DWZ
09-03-2002, 04:52 AM
I tried to run the SQL commandUPDATE template SET templatesetid="-1" where title="modifyprofile_country"With FireFly's run sql query from admin cp hack and I get a database error:Database error in vBulletin Control Panel 2.2.7:

Invalid SQL: UPDATE template SET templatesetid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

Date: Tuesday 03rd of September 2002 05:50:41 AM
Script: http://www.consoleradar.com/forums/forums/admin/query.php
Referer: http://www.consoleradar.com/forums/admin/query.phpIs that his hack or this hack that is having this problem? :confused:

kira
09-03-2002, 08:42 PM
Just wanted to say I installed this hack on 2.2.6 and it worked flawlessly. I did take care to tweak the syntax in the hack that, as I think HellSatan mentioned earlier, seems to have been made for an older version of vB -- maybe some of you who are having problems the code can make sure you do the same?

In the instructions relating to member.php, make note of these changes:

When the instructions tell you to ...

find:
$templatesused .= "register_birthday,modifyprofile_customtext,registe r_customfields,usercpnav,modifyprofile";

Replace it with
// Country Hack Replace
// $templatesused .= "register_birthday,modifyprofile_customtext,registe r_customfields,usercpnav,modifyprofile";
$templatesused .= "register_birthday,modifyprofile_customtext,modifyp rofile_country,register_customfields,usercpnav,mod ifyprofile";
// Country Hack End




Do this instead:


find:
$templatesused = "register_birthday,modifyprofile_customtext,registe r_customfields,usercpnav,modifyprofile";

Replace it with

// Country Hack Replace
// $templatesused = "register_birthday,modifyprofile_customtext,registe r_customfields,usercpnav,modifyprofile";
$templatesused = "register_birthday,modifyprofile_customtext,modifyp rofile_country,register_customfields,usercpnav,mod ifyprofile";
// Country Hack End

and (also in the member.php instructions) where it says to:


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


instead of that, do this...


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


Hope this makes sense and is correct. Basically, there were extra dots that didn't need to be there. Maybe the instructions could be updated?

Anyway, great hack, thank you very much!

DWZ
09-09-2002, 07:01 AM
Originally posted by DWZ
I tried to run the SQL commandUPDATE template SET templatesetid="-1" where title="modifyprofile_country"With FireFly's run sql query from admin cp hack and I get a database error:Is that his hack or this hack that is having this problem? :confused: *bump*

AJR
10-22-2002, 08:52 AM
DWZ... try using apostrophes (') instead of quotes (") around the -1 in the query.

DWZ
10-22-2002, 09:04 AM
Originally posted by AJR
DWZ... try using apostrophes (') instead of quotes (") around the -1 in the query. that worked!

thanks!

Talisman
11-03-2002, 09:32 PM
Thanks, AJR! Ours is an international community, so being able to display our national flags means a lot to everyone.

And thank you, Kira -- I started getting a bit nervous about installing this one and was so happy to see the summary update you posted.

I probably held my breath through the whole thing..... but it works!! What a rush!

Harken
11-12-2002, 09:05 PM
hmmm..i installed the country hack..and now when im logged in as admin i see the option in the usercp and it works fine...but if i log in as a registered user..the scroll list is gone in the usercp...but the option for country is still there so its just a blank no bar to scroll or anything. Any ideas?

Erwin
11-12-2002, 09:26 PM
Originally posted by Harken
hmmm..i installed the country hack..and now when im logged in as admin i see the option in the usercp and it works fine...but if i log in as a registered user..the scroll list is gone in the usercp...but the option for country is still there so its just a blank no bar to scroll or anything. Any ideas?

You need to run the database query to make the modify_country template default ie. templatesetid=-1

Harken
11-12-2002, 09:42 PM
i ran that before and i show it under the User Option Templates....there is 3 of them...weird...should there be only 1 right? but it still doesnt work..

Erwin
11-12-2002, 09:45 PM
Delete all of them.

Add a new one.

Then run the query.

Harken
11-13-2002, 02:34 PM
ok i deleted it..the one under templates in phpmy admin..but still i have two showing up when i open templates user options under that style...so i can still only see the list as admin...not under any other kind.

Erwin
11-13-2002, 05:54 PM
Can't you remove them from your Admin CP in Templates?

Harken
11-13-2002, 06:03 PM
no because the only options i c are Change original...unless im missing something..

TECK
11-13-2002, 06:17 PM
hmmm is normal there are so many boards out there with all kind of problems and security issues... due to bad code.
i made for you a little script to add and remove safely one or several templates:
<?php
error_reporting(E_ALL);

require('./global.php');

cpheader('<title>Templates</title>');

function dotemplate($title, $template, $templatesetid=-1) {
global $DB_site;

$DB_site->query("INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,'$templatesetid','" . addslashes($title) . "','" . addslashes($template) . "')");
echo "Installing $title template... Done.<br>\n";
}

function killtemplate($title, $templatesetid=-1) {
global $DB_site;

$DB_site->query("DELETE FROM template WHERE title='" . addslashes($title) . "' AND templatesetid=-1");
echo "Removing $title template... Done.<br>\n";
}

$DB_site->reporterror = 1;

// add a template
dotemplate('yourtemplatename', 'yourtemplatehtmlcode');

// remove a template
killtemplate('yourtemplatename');

cpfooter();
?>

Harken
11-13-2002, 06:21 PM
im sorry but what do i do with that....today has not been my day...

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:
*** 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:
eval("\$countrytext.= \"".gettemplate("modifyprofile_country")."\";");

(There are 2 instances)

Before that add:
$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,registe r_customfields,usercpnav,modi fyprofile";
$templatesused .= "register_birthday,modifyprofile_customtext,modifyp rofile_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='".addslashes($customtext)."',email ='".addslashes(htmlspecialchars($email))."',parentemail='".addslashes(htmlspecia lchars($parentemail))."',coppauser='$coppauser',homepage='".addslashes(htmlspeci alchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addsl ashes(htmlspecialchars($aim))."',yahoo='".addslashes(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='".addslashes($customtext)."',email ='".addslashes(htmlspecialchars($email))."',parentemail='".addslashes(htmlspecia lchars($parentemail))."',coppauser='$coppauser',homepage='".addslashes(htmlspeci alchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addsl ashes(htmlspecialchars($aim))."',yahoo='".addslashes(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='".addslashes($customtext)."',email ='".addslashes(htmlspecialchars($email))."',parentemail='".addslashes(htmlspecia lchars($parentemail))."',coppauser='$coppauser',homepage='".addslashes(htmlspeci alchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addsl ashes(htmlspecialchars($aim))."',yahoo='".addslashes(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

ajk
02-22-2003, 06:27 AM
Hi, the usuers on my BBS like this hack.

They asked if I can get one made with the US state flags and territories. Have one line for the state flag and another line for the country.

Thanks in adavance

Mr H
02-28-2003, 03:20 AM
I installed this hack and now when users try to change the "location" in their profile it says "Thanks for updating your profile" but the location doesnt show up.

Any ideas on where I messed up?

Funkie
03-13-2003, 05:37 AM
hi,
I have read right through this rather large post now:)

I got it working fine in all of the templates,but it will not show up in the postbit:(:(
Can any1 help please


Thanx in advance

forget that.sorted now,just added some txt to the showthread,and its working fine:)
Many thanx to you all

Mr L
03-30-2003, 02:53 PM
Can anyone offer any advice who has added additional flags.

One of my members wanted an Ex-Pat flag that I called "United Kingdom Ex Pat.gif" and put into the flags directory.

I modified the template and added this line...

<option value="United%20Kingdom%20Ex%20Pat" $ctryUnited_Kingdom_Ex_Patselected>United Kingdom Ex Pat</option>

...under the User Control panel all works well. They can select their flag.

However under the Admin options I cannot see the new flag, when you look at their profile it appears with a blank name on the right hand side in the country field drop down box. At no point is that flag selectable by Admins.

I'd appricahte any help on this.

Thanks.

leitel
04-01-2003, 02:03 PM
Has anyone modified the member search to include an option to search by country?

Tim Wheatley
04-02-2003, 05:56 PM
03-30-03 at 04:53 PM HLodder said this in Post #224 (https://vborg.vbsupport.ru/showthread.php?postid=375524#post375524)
Can anyone offer any advice who has added additional flags.

One of my members wanted an Ex-Pat flag that I called "United Kingdom Ex Pat.gif" and put into the flags directory.

I modified the template and added this line...

<option value="United%20Kingdom%20Ex%20Pat" $ctryUnited_Kingdom_Ex_Patselected>United Kingdom Ex Pat</option>

...under the User Control panel all works well. They can select their flag.

However under the Admin options I cannot see the new flag, when you look at their profile it appears with a blank name on the right hand side in the country field drop down box. At no point is that flag selectable by Admins.

I'd appricahte any help on this.

Thanks.


user.php needs the line adding too.

Splitfyre
04-12-2003, 04:43 PM
I don't seem to see the following in adminfunctions.php:

$post[joindate]=vbdate($registereddateformat,$post[joindate]);

We're running 2.28

Dean C
04-12-2003, 05:53 PM
Spitfyre - you may want to consider upgrading to the latest stable release of vbulletin (2.3.0) as the previous versions have many bug fixes which could leave a big security hole in your board :)

I have just checked in a clean 2.2.8 in functions.php and that line is there :)

- miSt

Splitfyre
04-12-2003, 10:11 PM
I was looking at the wrong file because I read the script instructions wrong. I thought he was referring to adminfunctions not functions.php

Splitfyre
04-12-2003, 11:04 PM
Ack.. someone help: http://www.futurelooksforums.com/forums/showthread.php?postid=58418#post58418

2. With the tweak it moved my ICQ button to the next line? How can I fix that?

Splitfyre
04-12-2003, 11:19 PM
Anyone know how to ensure that this gets stuck at the bottom right for each post:

Report this post to a moderator | IP: Logged
Warning Level: 0 [ View User Warnings ] [ Warn This User ]

For some reason it won't sit there in certain posts. Thoughts?

X-Fan
05-27-2003, 03:59 AM
Hey all, I just searched through the thread but couldn't find an answer - how would I get a user's flag to show up in the welcome panel on the forumhome page?

reismarktq2
06-06-2003, 02:40 PM
Have it installed and working great on 2.3.0 WITH the store hack add-on. Thanks!

Vinney
06-09-2003, 04:11 PM
ok ... i've installed this ok. Well it seems ok. But, the images are broken :

and are linked like :

/images/flags/Un.gif

instead of

/images/flags/United Kingdom.gif

Why is this happening ?? ( Also the alt text is the same )

Sc0rp
06-09-2003, 04:39 PM
is there any way to have this work automated.. so the script will trace where the user origins from..

Rasbelin
06-10-2003, 08:54 AM
Splitfyre,

you didn't put the code in the correct place in memberlist or/and memberlistbit. Both codes for the flag has to be at the same spot, e.g. before AIM icon. Should work. As for your second question, it's related to the warning system add-on. See the right support thread for info about it.

X-Fan,

I assume you need to tweak the code similar to member.php and then use $flag in the appropriate template. Try to figure it out yourself. Should be quite easy. I haven't had the welcome panel in use, so I can't test it now.

Vinney,

double check your code. You must have made some misstake. Works perfect here with a hacked vB 2.3.0.

Sc0rp,

that would require quite much work and yet it wouldn't be accurate.

CRego3D
06-15-2003, 06:26 PM
thanks for this great hack

I have modify it to display Linux Distro's instead of flags in my forum http://linuxcult.com

now ..

is there a way I can tie a URL to each "flag" ?

CRego3D
06-16-2003, 04:29 PM
One last request :)

http://www.linuxcult.com/forum/memberlist.php?&what=datejoined

as you see, the "distro" images is where the flags woudl be .. is there a way I can "sort" by them ? :)

love this hack .. hehe

Splitfyre
06-22-2003, 02:26 AM
Just updated to 2.30 and now it won't show the drop down to select a flag when you try to register :(

I went and re-hacked it from scratch. Check it out here:

www.futurelooks.com/forums/register.php

Splitfyre
06-22-2003, 09:06 PM
Got it installed fine now. I think it was just due to the time I was hacking it, I was near fallin asleep :P

Now my question is that in the postbit it shows the country flag squished.

See my forums: www.futurelooks.com/forums for more on this.

Please and thanks!

DPoole
06-22-2003, 09:30 PM
flag dont look squashed to me - thats the way its shows and looks ok

add <br> before and after it to make a space

Splitfyre
06-22-2003, 10:19 PM
Thanks. Ya I found that it was just the Australia flag that's squished in that flag icon set.

Splitfyre
06-26-2003, 04:34 AM
Quick Question: I have Country showing up twice in my registration.

I've checked the register.php file and I've also checked the registration templates. Why would the Country selection showup twice?

http://www.futurelooks.com/forums/register.php

Ninth Dimension
06-28-2003, 02:24 AM
Just installed this hack on a 2.3.0 board, and it's working a charm, thank you very much

09-06-01 at 10:46 AM AJR said this in Post #1 (https://vborg.vbsupport.ru/showthread.php?postid=167581#post167581)
Known Problems:
- Countries with a dash (-) or comma (,) will not show up
automatically in as selected when you or the member edit
their profile (Congo, Korea, and Micronesia are the only 3)
Anyone know a fix please let me know.


Taking a very quick glance as your code, I think it's not working because you are using variables named after the countries to call whichever country needs to be selected. In thory this works, until an invalid char comes into the arrangement, amnd breaks the variable.

In other words $ctryTogoselected - $ctryUnited_Kingdomselected & even $ctryBritish_Indian_Ocean_Territoryselected are all valid variable names, but $ctryUmm_al-Qaiwanselected is not. (all the computer see's is $ctryUmm_al).

Update the variables to remove the hyphens and comma's and it will work

(sorry if someone else has already posted this soloution, i've not read the thread or anything, i just knew this was the problem from looking at the code.

anyway, like i said, great hack, thank you very much.

Ninth Dimension
06-28-2003, 02:33 AM
06-26-03 at 06:34 AM Splitfyre said this in Post #243 (https://vborg.vbsupport.ru/showthread.php?postid=412830#post412830)
Quick Question: I have Country showing up twice in my registration.

I've checked the register.php file and I've also checked the registration templates. Why would the Country selection showup twice?

http://www.futurelooks.com/forums/register.php


It's controled by the template, i can't see a mistake in the file edit causing this, all I can suggest is that you maybe use my template, it's unmodified (bar the flag hack that is).

it's attached as a .txt

Sin City
06-29-2003, 12:57 AM
great hack.... i used it along with the store ... only problem is.... when i buy the flag... it shows up in the "Your Country Flag" option in the store in the "Country" field.... but i don't see a flag anywhere in my posts, or in the member list... what's wrong?

also, when a new user tries to sign up it says to make sure and fill out all necessary fields, even though they have filled them all in (there is no profile field for the flag either since its in the store)... what can i do to fix that?

ajk
06-29-2003, 12:59 AM
The users at Drumsmith.com really like the Country Flag hack.

Is there a way I can use the small flags in one place, then use the large in another?

Thanks

Sin City
06-30-2003, 06:10 AM
Yesterday at 02:57 AM Sin City said this in Post #246 (https://vborg.vbsupport.ru/showthread.php?postid=413792#post413792)
great hack.... i used it along with the store ... only problem is.... when i buy the flag... it shows up in the "Your Country Flag" option in the store in the "Country" field.... but i don't see a flag anywhere in my posts, or in the member list... what's wrong?

also, when a new user tries to sign up it says to make sure and fill out all necessary fields, even though they have filled them all in (there is no profile field for the flag either since its in the store)... what can i do to fix that?

bump

Sin City
07-01-2003, 02:45 AM
can anyone help me please?

Ninth Dimension
07-01-2003, 08:04 AM
06-29-03 at 02:57 AM Sin City said this in Post #246 (https://vborg.vbsupport.ru/showthread.php?postid=413792#post413792)
great hack.... i used it along with the store ... only problem is.... when i buy the flag... it shows up in the "Your Country Flag" option in the store in the "Country" field.... but i don't see a flag anywhere in my posts, or in the member list... what's wrong?

also, when a new user tries to sign up it says to make sure and fill out all necessary fields, even though they have filled them all in (there is no profile field for the flag either since its in the store)... what can i do to fix that?

From the sounds of it you have not made any of the template changes, i recomend going back to the instructions and following them again.