![]() |
Make other Profile fields parse as URLs?
The homepage profile field automatically parses as a URL.
On my site, I have two profile fields that would be dramatically improved if they were automatically treated as URLs (they are entries where a player can put a link to a RL picture and a character picture). Is there a way to do this? Thanks! |
If they're just URLs, just edit the appropriate templates to include <a> tags...
|
I don't want *ALL* of the profile fields to be parsed as URLs.
For example, user profiles on my vBulletin have 6 required fields and 9 optional fields. 1 required field is email address, the other 5 are plain text. Of the optional fields, 1 is a URL (homepage), 1 is signature, 1 is birthday, 1 is custom user text, and the other 5 are plain text. I want 2 of those last 5 to be parsed as URLs, rather than plain text. Unless I am missing something, the template just parses through a loop and treats them all the same, thus I cannot edit each individual one. Or am I missing something and not remembering or understanding correctly how the profile template works? The two fields I want treated as URLs are called "Your Real Life Picture" and "Your Character's Picture." I just used the Template Search function to look for those, and the search turned up nothing. Am I just not understanding the way the template functions for parsing the user profile fields? |
Ok, from further reading through the various files, everywhere the custom fields are handled (either for changing them or for viewing them), the code always says this:
$customfields However, I cannot find where it is that I can edit that. I have done numerous searches to no avail. :( |
Look in functions.php for profile[fieldx].
Be sure to replace the x with the profile field number you are looking for. |
Even further investigation has found that this is the template that handles the parsing of the custom fields:
getinfo_customfields Quote:
Quote:
Is there any way to only have it change a couple specific ones into URLs? I don't imagine if() statements work here. :p |
Quote:
Ok, I am looking through that file (admin/functions.php) and when I search for profile the only place it comes up is here: Line 260: eval("\$post[profile] = \"".gettemplate("postbit_profile")."\";"); Line 283: $post[profile]=""; |
Ugh. I hate reading code I do not fully understand. It makes me feeling like a programming n00b all over again.
As I read further, could it be THIS that I need to modify? member.php lines 1379-1399: Code:
// get extra profile fields $profilefield[value]=$userinfo[$profilefieldname]; Should be changed to something like this? ==> Code:
if($profilefieldname == "Your Real Life Picture" || $profilefieldname == "Your Character's Picture") { Code:
if($profilefieldname == "Your Real Life Picture" || $profilefieldname == "Your Character's Picture") { ??? |
Problem solved due to something I read in another hack.
Zzed's hack found here had code for making an image show up in a profile field. It turns out I was looking in exactly the right place, but I just needed to know the proper php syntax to do this properly. I must say that I am shocked to learn that PHP uses "and" and "or" instead of "&&" and "||". What kind of language doesn't use && and || ??????????? Anyway, this is how I accomplished the hack: I changed this line (1395): $profilefield[value]=$userinfo[$profilefieldname]; to: Quote:
Does anyone see any problems or flaws in my hack? |
All times are GMT. The time now is 05:54 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|