admin (no pm's please) Site Admin


 Virtual Cash: 21300
Joined: 22 May 2005 Posts: 25231
Add Karma
 rated by 211 members
Add Comment
Show Comments
 |
Posted: Wed Jun 17, 2009 9:26 am Post subject: phpBB3: New userinfo/welcome portal |
|
|
Much like the phpbb2 USERINFO portal, this portal gives access to AVATAR/RANK/IP and some other profile details. It also links the user to the country code database identifying where they are form via a profile field you can set up.
-----------
(phpbb3 only)
To add the country flag profile, create a Single Text Field profile field called "Country", leave everything default.
Open viewtopic_body.html, and add this where you want the flag to show (see http://howtodoit.myfabforum.org for more defails):
| Code: | <!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Country" -->
<img src="./ranks/ccflags_medium/{postrow.custom_fields.PROFILE_FIELD_VALUE}.png" /><br />
<!-- ENDIF -->
<!-- END custom_fields --> |
This will show now show the flag on the side when viewing a topic.
_________________
Family Friendly Shareware | | Web Design/Services | Free Forums
|
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 6:39 pm Post subject: |
|
|
How can we set up the profile field?
We can't just do the xprofile field like phpbb2... so how would we do it? _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 21300
Joined: 22 May 2005 Posts: 25231
Add Karma
 rated by 211 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 6:47 pm Post subject: |
|
|
Does it matter which kind? Since phpbb3 requires you to select boolean, single text, text field, numbers, dropdown box, and date.
I've tried it with the single text and text field, but nothing came up. _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 21300
Joined: 22 May 2005 Posts: 25231
Add Karma
 rated by 211 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 6:53 pm Post subject: |
|
|
text is good, but there is good reason nothing happened I expect.
to save load your flag is a cookie, only when the cookie is not there (or showing an invalid value in which case a retry occurs randomly) does the flag get found again, and only then does the profile field get set. _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
|
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 7:30 pm Post subject: |
|
|
Well, after some playing I got it up, for some reason the profile field didn't want to show up... removed and readded with copy/paste a few times and it worked... oddly.
Anyway, the cookie is set and read properly.. but there's one problem: The info it puts into the profile field is just the code. Mine now shows US, nothing more.
perhaps it needs something to change that code into the flag? Maybe editing the code something like:
Note: Random rough draft just for an idea...
| Code: | <!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Country" -->
<img src="./flag_code/{postrow.custom_fields.PROFILE_FIELD_VALUE}.png"><br />
<!-- ENDIF --> |
Would that be the easiest way to do it, since then it would just replace it to use the country code in the image tag? _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 21300
Joined: 22 May 2005 Posts: 25231
Add Karma
 rated by 211 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 7:36 pm Post subject: |
|
|
That does seem to be the way to do things in phpbb3 phpbb3 profile fields really are terminally useless compared to what we did with xprofile fields in phpbb2. _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
|
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 7:38 pm Post subject: |
|
|
Would it be useful to create that as a portal, then just instruct people to create the single text area profile field "country"?
That would make things much easier for everybody that wants it, I think.
Then again, a quick guide into the phpbb3 howtodoit would be just as easy. _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 7:50 pm Post subject: |
|
|
Just played with it, and might need it as a portal.
The problem is that using the code..
| Code: | <!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "Country" -->
<img src="./images/ranks/ccflags_medium/{postrow.custom_fields.PROFILE_FIELD_VALUE}.png" /><br />
<!-- ENDIF --> |
works great, besides one small problem... the country codes are stored in upper case, but the flags are stored as lowercase. So it's looking for say US.png when only us.png exists.
Any ideas that don't involve javascript? _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 21300
Joined: 22 May 2005 Posts: 25231
Add Karma
 rated by 211 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
Posted: Thu Jun 18, 2009 8:05 pm Post subject: |
|
|
Works, but I noticed one thing, don't think it's really relevant though.
If the cookie is already set, it isn't resetting it, and if the cookie is deleted then this error pops up on the userinfo portal
| Code: | | [phpBB Debug] PHP Notice: in file /myffcms/com_userinfo.php on line 82: Cannot modify header information - headers already sent by (output started at /includes/template.php:831) |
It only pops up once until the cookie is set again. Noticed it because I had to delete the cookie to get it to set it as lowercase. _________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 21300
Joined: 22 May 2005 Posts: 25231
Add Karma
 rated by 211 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
admin (no pm's please) Site Admin


 Virtual Cash: 21300
Joined: 22 May 2005 Posts: 25231
Add Karma
 rated by 211 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
Zudane Moderator


 Virtual Cash: 13880
Joined: 10 May 2008 Posts: 1330
Add Karma
 rated by 17 members
Add Comment
Show Comments
 |
Posted: Fri Jun 19, 2009 5:06 am Post subject: |
|
|
a member pointed this out, I hadn't noticed...
That looks like it says unkhown. I'm not certain if it does or not, but that n sure looks like an h.
on a similar note...
is tiny... the smaller version is nigh more than a blue dot.
_________________
Harsh Reality - Unleash your creativity!
Harsh Reality |
|
| Back to top |
|
 |