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)

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 06:30 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.01391 seconds
  • Memory Usage 1,749KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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