vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Profile Enhancements - Friendster style hyperlinked profile fields (https://vborg.vbsupport.ru/showthread.php?t=61077)

buro9 02-01-2004 10:00 PM

Friendster style hyperlinked profile fields
 
No longer supported by the author.

buro9 02-02-2004 04:02 PM

A screenshot has been request, so find it attached.

Note that this is a logic only hack and does not use any phrases or languages stuff... thus it is suitable for all languages.

The screenshot shows each of the items in the profile fields as a hyperlink, and one of which is being hovered over... and you can see that the link generated is a search on the user profile fields.

FleaBag 02-02-2004 06:20 PM

This is excellent... Will definitely take a look at this when I switch to vB3, which shouldn't be too far away finally lol.

gmarik 02-02-2004 07:59 PM

Not bad. What are the future plans?

buro9 02-02-2004 08:57 PM

Quote:

Originally Posted by gmarik
Not bad. What are the future plans?

Erm... wasn't really thinking of any, it's just a simple hack.

It's not going to evolve into anything out there or major. It's just a small simple improvement that encourages users to bond a bit more.

If you can think of anything you want to add to it though... just say :)

Or add it and I'll modify the first post and give credit.

Elmer 02-04-2004 02:46 AM

Quote:

Originally Posted by buro9
Erm... wasn't really thinking of any, it's just a simple hack.

It's not going to evolve into anything out there or major. It's just a small simple improvement that encourages users to bond a bit more.

If you can think of anything you want to add to it though... just say :)

Or add it and I'll modify the first post and give credit.

hey this doesn't work for me... I see the links there but doesn't search for members with the same word in his custome profile fields... the link just take me to the member list:disappointed:

buro9 02-04-2004 05:02 AM

Quote:

Originally Posted by Elmer
hey this doesn't work for me... I see the links there but doesn't search for members with the same word in his custome profile fields... the link just take me to the member list:disappointed:

I don't touch the memberlist.php file at all (this is what actually performs the search on the memberlist), just the profile page to create the links.

The links it creates are just what the form would create if submitted via GET.

I notice that you can't search by those fields on your forum via the Advanced Member Search page on your site... have you set the fields to be searchable?

This is under Admin CP > User Profile Fields > User Profile Field Manager

/forums/admincp/profilefield.php?do=modify

If the field isn't searchable, then what you describe would happen.

Let me just test this and see what improvement I could make :)

buro9 02-04-2004 05:11 AM

Quote:

Originally Posted by buro9
I don't touch the memberlist.php file at all (this is what actually performs the search on the memberlist), just the profile page to create the links.

The links it creates are just what the form would create if submitted via GET.

I notice that you can't search by those fields on your forum via the Advanced Member Search page on your site... have you set the fields to be searchable?

This is under Admin CP > User Profile Fields > User Profile Field Manager

/forums/admincp/profilefield.php?do=modify

If the field isn't searchable, then what you describe would happen.

Let me just test this and see what improvement I could make :)

Updated the hack to take this into account.

buro9 04-10-2004 08:06 AM

Quote:

Originally Posted by buro9
Updated the hack to take this into account.

Does anyone want to see this applied to the postbits too? For those of you who show location, etc there?

FleaBag 04-12-2004 05:25 PM

I wouldn't mind that. Installing this right now. :)

moley 05-06-2004 04:05 PM

seems like a great hack i'll be adding this later tonight.

Fluous 05-08-2004 02:32 AM

You should make it so things via the Search Panel can be done like this. Like sometimes I remember a persons instant messenger, and not the thread. So it takes forever to search it. It would be handy to be able to search their messenger and other profile information like DOB and anything applicable into the search part. And if something was added it would automatically add it into the search box. That part would be a little complicated though lol.

Mobo 05-14-2004 11:42 PM

I just did this to my 3.0.1 forum and it did not do any thing. The entered text is not a link at all.

Any thoughts?

Thanks.

buro9 05-15-2004 10:42 AM

Quote:

Originally Posted by Mobo
I just did this to my 3.0.1 forum and it did not do any thing. The entered text is not a link at all.

Any thoughts?

Thanks.

There's only two changes, so I can't imagine what the problem is, but have you made both changes? Uploaded the files? Stated that the fields are searchable in the control panel? etc?

If you've done all of the above, then send me an e-mail with the file attached and I'll look into why it didn't work: d a v i d @ b u r o 9 . c o m

Cheers

David K

Mobo 05-15-2004 08:00 PM

Yep, did both parts and uploaded the file. Not sure why it's not working. I also set all the profile fields to searchable in the User Profile Fields options via the Admin CP. I'll email you the file that I have.

Thanks for the help.

MaxScript 05-15-2004 08:07 PM

i third this 301

buro9 05-15-2004 08:50 PM

Quote:

Originally Posted by MaxScript
i third this 301

Yours is related to the way in which you had pasted in the code... you did not keep the linebreaks, so my "// HACK : START" comment then comments out the entire hack.

You need your entire custom profile fields block to be exactly this:

PHP Code:

// *********************
// CUSTOM PROFILE FIELDS

// HACK : START : FRIENDSTER STYLE LINKS
//$profilefields = $DB_site->query("
//  SELECT profilefieldid, required, title, type, data, def, height
//  FROM " . TABLE_PREFIX . "profilefield
//  WHERE form = 0 " . iif(!can_moderate(), "
//    AND hidden = 0") . "
//  ORDER BY displayorder
//");

$profilefields $DB_site->query("
  SELECT profilefieldid, required, title, type, data, def, height, searchable
  FROM " 
TABLE_PREFIX "profilefield
  WHERE form = 0 " 
iif(!can_moderate(), "
    AND hidden = 0"
) . "
  ORDER BY displayorder
"
);
// HACK : END : FRIENDSTER STYLE LINKS

while ($profilefield $DB_site->fetch_array($profilefields))
{
  
exec_switch_bg();
  
$profilefieldname "field$profilefield[profilefieldid]";
  if (
$profilefield['type'] == 'checkbox' OR $profilefield['type'] == 'select_multiple')
  {
    
$data unserialize($profilefield['data']);
    foreach (
$data AS $key => $val)
    {
      if (
$userinfo["$profilefieldname"] & pow(2$key))
      {
        
$profilefield['value'] .= iif($profilefield['value'], ', ') . $val;
      }
    }
  }
  else
  {
    
$profilefield['value'] = $userinfo["$profilefieldname"];
  }
  if (
$profilefield['value'] != '')
  {
    
$show['extrainfo'] = true;
    
// HACK : START : FRIENDSTER STYLE LINKS
    
if ($profilefield['searchable']) {
      
$profileLinks explode(','$profilefield['value']);

      for (
$ii 0$ii count($profileLinks); $ii++) {
        
$profileLinks[$ii] = '<a href="memberlist.php?do=getall&'.$profilefieldname.'='.urlencode(trim($profileLinks[$ii])).'">'.$profileLinks[$ii].'</a>';
      }

      
$profilefield['value'] = implode(','$profileLinks);
    }
    
// HACK : END : FRIENDSTER STYLE LINKS

  
}
  eval(
'$customfields .= "' fetch_template('memberinfo_customfields') . '";');

}
// END CUSTOM PROFILE FIELDS
// ************************* 


buro9 05-15-2004 08:53 PM

Quote:

Originally Posted by Mobo
Yep, did both parts and uploaded the file. Not sure why it's not working. I also set all the profile fields to searchable in the User Profile Fields options via the Admin CP. I'll email you the file that I have.

Thanks for the help.

Received the file, but in case you didn't get my reply via e-mail, here it is:

I uploaded your version of the file and it worked perfectly on my
forum. Which means that it's a setting.

Are members allowed to perform advanced searches on your boards for
other members?

Also, in the Admin Control Panel at this point:
User Profile Fields > User Profile Field Manager

Are the fields that you want hyperlinking defined as being
'Searchable'?

If users do not have permission to do an advanced search, and/or the
field isn't searchable... then it won't create the hyperlinks for you.

The hack is working though, your file worked perfectly on my forum, so
it's definately a setting rather than a code fault.

Mobo 05-18-2004 07:36 AM

buro9, I never got the email from you so I'm glad you posted this here as well. I do have all the feilds set to searchable, but I'm not sure about the advanced search. Where do I find that. Sorry I'm a noob at VB3!!

Thanks gain.

buro9 05-18-2004 09:06 AM

Quote:

Originally Posted by Mobo
buro9, I never got the email from you so I'm glad you posted this here as well. I do have all the feilds set to searchable, but I'm not sure about the advanced search. Where do I find that. Sorry I'm a noob at VB3!!

Thanks gain.

You'll find the setting in the Admin Control Panel.

vBulletin Options > User Listing & Profile Viewing > Allow Advanced Searches = Yes

I think that might do it, if the fields are searchable already then this is the only option I can think of that might impact it.

Let me know how you get on... if you have trouble I'll look into it some more :)

Mobo 05-18-2004 11:38 AM

Okay, I just check to see if I had advanced searching enabled, and I did. So all fields are searchable and my users are allowed to search, but I'm still not getting any link :(

Thanks for all the help man!

klassicd 05-20-2004 05:26 PM

Error:

There is a problem when the field that you want to search by is a list/menu drop down box. Instead of searching by the name of the field you need to search by the value (usually 0,1,2,3,4,etc...). Can this be fixed?

Cham911 06-18-2004 08:12 PM

Has anyone worked with this hack enough to get it to use the $key values foro multiple boxes etc?

If nobody has it already, I will do it in a few days, but I don't want to learn that part of it unless I have to :)

sabret00the 07-28-2004 10:14 PM

what's the server load like?

Roxie 07-29-2004 12:01 AM

I added some things to my profile after this hack was added, but what I added did not become links. hmmm.

Roxie 07-30-2004 06:24 PM

Well, this hack screwed up the post per day count.

Roxie 08-04-2004 11:05 PM

Did anyone else's polls and post per day count mess up after installing this?

buro9 08-08-2004 09:50 AM

Quote:

Originally Posted by sabret00the
what's the server load like?

The server load isn't affected as this is merely a split and join of a string to an array and back to a string.

There is no disk I/O, no database reads or writes... it's pure CPU work within the current PHP thread. And if you have a performance optimiser installed such as mmcache, then even with thousands of users doing this simultaneously you're not going to see a difference.

It uses all existing vBulletin code, simply does a whip through the string and creates links out of them.

The only side effect at all is increased HTML in the member profile page... but that doesn't count either, as if you're gzip'ing output... the repeated URL text would be compressed to very little indeed.

Server load is neglible to non-existant.

buro9 08-08-2004 09:53 AM

Quote:

Originally Posted by Roxie
I added some things to my profile after this hack was added, but what I added did not become links. hmmm.

Sorry for not replying sooner... was on holiday in Barcelona.

The fields will only be searchable and therefore linkable if you permit users to search those fields already and have granted the advanced search permission to the usergroup.

Note that this hack cannot affect your post counts... it doesn't touch them! It's very small and just affects the display of a small piece of HTML on the member profile page and nowhere else... so another hack must've broken those for you.

If your post counts are out, you should update counters in your admin control panel.

Roxie 08-10-2004 02:04 AM

Thanks.
It seems as if decimal points have been removed. The post counts are fine. It's the average per day. Instead of 3.96 posts per day it says 396. And for the polls, instead of 17.00% it says 1700%. I didn't notice this until I added this hack, but I'll guess I'll go through and look at everything.

Tru Smiles 11-16-2004 06:34 PM

I'm trying to install this hack, but unfortunetly I have another hack that seems to be clashing with the code. Where your code says "iif(!can_moderate(), " mine says "iif(!($permissions['genericpermissions'] & CANSEEHIDDENCUSTOMFIELDS)," - I've tried overwriting and including it in the code, but I get a parse error. I'm using 303 so maybe its just that and not my code? >_>

KTBleeding 11-16-2004 09:33 PM

Quote:

Originally Posted by Tru Smiles
I'm using 303 so maybe its just that and not my code?

Yes, it is because of 3.0.3 Dissapointing cause I loved this hack. Anyone know how to update it for 3.0.3?

Tru Smiles 11-17-2004 04:53 PM

Oooh, we have to start a petition to get it for 303!! :D :D

buro9 11-19-2004 12:12 PM

Quote:

Originally Posted by Tru Smiles
Oooh, we have to start a petition to get it for 303!! :D :D

It's coming next week :)

Dead computer prevented me from responding sooner :)

And they way to get it is to ask as KTBleeding did ;)

Tru Smiles 11-20-2004 08:36 AM

Quote:

Originally Posted by buro9
It's coming next week :)

Dead computer prevented me from responding sooner :)

And they way to get it is to ask as KTBleeding did ;)

I love you :D

buro9 11-27-2004 09:44 PM

Tsk people.

I've updated it for you... but really... you could have done that yourself ;)

It was only a one word change!

Anyhow... it's now 3.0.3 supported... the mod has been edited to reflect this.

KTBleeding 11-27-2004 11:37 PM

Works just as well as before. Thanks again buro.

Tru Smiles 11-30-2004 07:49 AM

Thank yoooooouuu ^___^ Works great!

zennation 12-06-2004 09:29 PM

Took the code and hacked it so it should be able to search checkboxes etc...

Let me know if any problems...

Code:


// *********************
// CUSTOM PROFILE FIELDS

// HACK : START : FRIENDSTER STYLE LINKS
//$profilefields = $DB_site->query("
//  SELECT profilefieldid, required, title, type, data, def, height
//  FROM " . TABLE_PREFIX . "profilefield
//  WHERE form = 0 " . iif(!can_moderate(), "
//    AND hidden = 0") . "
//  ORDER BY displayorder
//");

$profilefields = $DB_site->query("
  SELECT profilefieldid, required, title, type, data, def, height, searchable
  FROM " . TABLE_PREFIX . "profilefield
  WHERE form = 0 " . iif(!can_moderate(), "
    AND hidden = 0") . "
  ORDER BY displayorder
");
// HACK : END : FRIENDSTER STYLE LINKS

while ($profilefield = $DB_site->fetch_array($profilefields))
{
  exec_switch_bg();
  $profilefieldname = "field$profilefield[profilefieldid]";
  if ($profilefield['type'] == 'checkbox' OR $profilefield['type'] == 'select_multiple')
  {
    $data = unserialize($profilefield['data']);
       
    foreach ($data AS $key => $val)
    {
      if ($userinfo["$profilefieldname"] & pow(2, $key))
      {
        $profilefield['value'] .= iif($profilefield['value'], ', ') . $val;
                $profilefield['value2'] .= iif(isset($profilefield['value2']), ',') .vb_number_format($key+1);               
      }
    }
  }
  else
  {
    $profilefield['value'] = $userinfo["$profilefieldname"];
  }
  if ($profilefield['value'] != '')
  {
    $show['extrainfo'] = true;
    // HACK : START : FRIENDSTER STYLE LINKS
    if ($profilefield['searchable']) {
      $profileLinks = explode(',', $profilefield['value']);
      $profileLinks2 = explode(',', $profilefield['value2']);
      for ($ii = 0; $ii < count($profileLinks); $ii++)
          {
            if ($profilefield['type'] == 'checkbox' || $profilefield['type'] == 'select_multiple' ) {
                        if ($profilefield['type'] == 'checkbox') {
                                $profileLinks[$ii] = '<a href="'.$vboptions[bburl].'/memberlist.php?do=getall&'.$profilefieldname.'[]='.$profileLinks2[$ii].'">'.trim($profileLinks[$ii]).'</a>';                                                       
                        } else {
                                $profileLinks[$ii] = '<a href="'.$vboptions[bburl].'/memberlist.php?do=getall&'.$profilefieldname.'='.$profileLinks2[$ii].'">'.trim($profileLinks[$ii]).'</a>';                                                       
                        }               
            } else {   
                $profileLinks[$ii] = '<a href="'.$vboptions[bburl].'/memberlist.php?do=getall&'.$profilefieldname.'='.urlencode(trim($profileLinks[$ii])).'">'.$profileLinks[$ii].'</a>';               
            }
      }

      $profilefield['value'] = implode(',', $profileLinks);
    }
    // HACK : END : FRIENDSTER STYLE LINKS

  }
  eval('$customfields .= "' . fetch_template('memberinfo_customfields') . '";');

}
// END CUSTOM PROFILE FIELDS
// *************************


buro9 12-06-2004 09:49 PM

Quote:

Originally Posted by zennation
Took the code and hacked it so it should be able to search checkboxes etc...

Let me know if any problems...

If others can confirm that this works for them, I'm happy to merge it back into the first post/ hack and to add you to the hack credits :)

Thx btw... this is how I like vb.org to work... that anyone feels that they can improve or extend hacks I make and feed those changes back in :)


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01588 seconds
  • Memory Usage 1,865KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete