state flags

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   state flags
Recoil
CZ Addict
Recoil has been a member for over 20 year's 20 Year Member
usa.gif louisiana.gif
Occupation: Manager
Gender: Male
Fav. Sports Team: New Orleans
Website:
Status: Offline
Joined: Jan 17, 2004
0.06 posts per day
Posts: 427
Points: 8,650
   ICQ Number
I'm trying to install the state flags mod and things were going great untill, I came across this line in the install instructions:
#-----[ FIND ]------------------------------------------
#
# (Approx. line 526)
#

$sql = "INSERT INTO " . USERS_TABLE . "   (user_id

#
#-----[ IN-LINE FIND ]------------------------------------------
#

user_from_flag,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#

user_from_state_flag,

I've attached the file i'm trying to edit. Any help would be apprieciated. Running 7.3, 2.0.11 and country flags work without errors.


Back to top Reply with quote
#2   re: state flags
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
Kelly_Hero has been a member for over 20 year's 20 Year Member
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 58
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.50 posts per day
Posts: 3765
Points: 351,412
   
Boy, somebody's not worried about whitespace in their files! icon_eek.gif LOL

Anyway, from looking at your code, it looks like there's a different version of one thing or another going on here. The code in the txt file you attached doesn't match the surrounding code for either of the only two places user_from_flag appears on the page.

But, what the instructions are telling you to do seems pretty simple. You just need to find:

user_from_flag

and replace it with:

user_from_state_flag

The first instance is here (line 950):


         // FLAGHACK-start-MOD

         

         $sql = "UPDATE " . USERS_TABLE . "

                                SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_from_flag = '$user_flag', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = '$viewemail', user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = '$attachsig', user_allowsmile = '$allowsmilies', user_allowhtml = '$allowhtml', user_allowbbcode = '$allowbbcode', user_allow_viewonline = '$allowviewonline', user_notify = '$notifyreply', user_notify_pm = '$notifypm', user_popup_pm = '$popup_pm', user_timezone = '$user_timezone', user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = '$user_style', user_active = '$user_active', user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "


and the second instance is here (line 1486):
   // FLAGHACK-start

   $user_flag = $userdata['user_from_flag'];   

// FLAGHACK-end


Try simply replacing those two instances. Of course, make a back up first! But you already knew that, I'm sure.

Oh, if you've already run the sql file, you can kinda check to see if that's right by looking in the USERS_TABLE to see if the field name is now user_from_state_flag. If it is, then you should be safe.


Back to top Reply with quote
#3   re: state flags
Recoil
CZ Addict
Recoil has been a member for over 20 year's 20 Year Member
usa.gif louisiana.gif
Occupation: Manager
Gender: Male
Fav. Sports Team: New Orleans
Website:
Status: Offline
Joined: Jan 17, 2004
0.06 posts per day
Posts: 427
Points: 8,650
   ICQ Number
Thanks Kelly! icon_smile.gif I did what u said and I think it worked out ok but, now, when I go to profiile I see a row for the state flag but, instead of it saying "state flag" it just has a ":" and a box that I assume is for the flags. I see no images or pulldown box. Can u please tell me where to start? I checked the db, "user_from_state_flag" is in the users table.

I wonder if my editor put all of those spaces in the code. If I remove them will my site run faster?



Back to top Reply with quote
#4   re: state flags
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
Kelly_Hero has been a member for over 20 year's 20 Year Member
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 58
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.50 posts per day
Posts: 3765
Points: 351,412
   
What are you looking at, View Profile or Edit Profile? If you're looking at View profile, it sounds like you still need to modify usercp_viewprofile.php. Editing your profile is done on usercp_register.php, which you've already modified.

Check the instructions and see if you're supposed to modify usercp_viewprofile.php as well. If so, post that and I'll look through it too.

It's hard for me to tell what needs to be modified without seeing everything in front of me and I don't have a Nuke site set up at the moment to test it on. icon_neutral.gif



Back to top Reply with quote
#5   re: state flags
Recoil
CZ Addict
Recoil has been a member for over 20 year's 20 Year Member
usa.gif louisiana.gif
Occupation: Manager
Gender: Male
Fav. Sports Team: New Orleans
Website:
Status: Offline
Joined: Jan 17, 2004
0.06 posts per day
Posts: 427
Points: 8,650
   ICQ Number
I'm looking at the profile page on my site when I'm logged in. I'll make u a UID and PW and PM the info to u.

Instructions:
#-----[ OPEN ]------------------------------------------
#

includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#
# (Approx. line 124)
#

$location .= $flag ;
// FLAGHACK-end

#
#-----[ AFTER, ADD ]------------------------------------------
#

// STATEFLAGHACK-start
if ($profiledata['user_from_flag'] == 'usa.gif')
{
   $state_flag = ( !empty($profiledata['user_from_state_flag'])) ? " ;;<img src=\"modules/Forums/images/state_flags/" . $profiledata['user_from_state_flag'] . "\" alt=\"" . $profiledata['user_from_state_flag'] . "\">" : "";
   $location .= $state_flag ;
}
// STATEFLAGHACK-end


My file:


Attached Files
usercp_viewprofile.rar (3.25 KB, Downloaded: 5233 Time(s))


Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum