Jump to content
WebFlake

Group Format (Hook) Fix for 3.4.x


Tony

Recommended Posts

Several applications and hooks will update the tbGfSkinSearch file, so often times you will find yourself needing to repeat this tutorial. Unfortunately there is no way around it until the original hook author updates the hook itself.

There's a fix posted in the official support thread that wouldn't need to be applied more than once. It would mean uninstalling the hook and editing the xml though.  http://community.invisionpower.com/topic/350317-download-tb-group-format/page-8

 

You can do some tweaks to the 4.1.1 version's XML file and then import it and it'll work without issues (at least none I've noticed so far) on 3.4.3 Open the xml file and find "public function profileModern" Replace the entire function with this:

public function profileModern( $tabs=array(), $member=array(), $visitors=array(), $default_tab='status', $default_tab_content='', $friends=array(), $status=array(), $warns=array(), $show_contact='' )    {	    /* Init vars */	    $_formatted	    = '';	    $namesToReplace    = array();	   		 /* Load our class and setup prefixes */	    require_once( IPS_ROOT_PATH . 'sources/classes/class_tbGroupFormat.php' );	   		 /* Get our main replaces */	    $_formatted = TBGroupFormat::makeNameFormatted( $member );	   		 $namesToReplace[ sprintf($this->lang->words['users_photo'], $member['members_display_name']) ] = sprintf($this->lang->words['users_photo'], $_formatted);	    $namesToReplace[ sprintf( $this->lang->words['rep_description'], $member['members_display_name'], $member['pp_reputation_points']) ] = sprintf( $this->lang->words['rep_description'], $_formatted, $member['pp_reputation_points']);	   		 $member['members_display_name'] = $_formatted;	   		 $return = parent::profileModern( $tabs, $member, $visitors, $default_tab, $default_tab_content, $friends, $status, $warns, $show_contact );	   		 if ( count($namesToReplace) )	    {		    foreach( $namesToReplace as $replace => $search )		    {			    $return = str_replace( $search, $replace, $return );		    }	    }	   		 return $return;    }
It was missing
, $show_contact=''
in the function and  
, $show_contact
in the $return string. 2nd thing you need to do is find the following in the tbGfSkinSearch function:
$data['last_poster'] = $data['last_poster_id'] ? IPSMember::makeProfileLink( TBGroupFormat::makeNameFormatted( $data, $data['last_poster_name'], $data['last_poster_group'], 'last_poster_id' ), $data['last_poster_id'], $data['seo_last_name'] ) : $this->settings['guest_name_pre'] . $data['last_poster_name'] . $this->settings['guest_name_suf'];
and comment it out, by that I mean make it look like this (add too forward slashes in front of it):
//$data['last_poster'] = $data['last_poster_id'] ? IPSMember::makeProfileLink( TBGroupFormat::makeNameFormatted( $data, $data['last_poster_name'], $data['last_poster_group'], 'last_poster_id' ), $data['last_poster_id'], $data['seo_last_name'] ) : $this->settings['guest_name_pre'] . $data['last_poster_name'] . $this->settings['guest_name_suf'];
And that's all that is to it really to make the current version work on the newest forum version!   The 2nd edit is for the "View New Content" to display correctly.
  • Upvote 1
  • Downvote 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
Guest Abdelghani

Sorry i don't understand this "<Your IPB Root> / Crochets / tbGfSkinSearch_xxxxx.php"

Link to comment
Share on other sites

  • Administrator

Open your favorite FTP program, navigate to your forum root folder, open the Hooks folder and search for that file. No idea where you're getting "crochets" from.. presumably a translator.

Link to comment
Share on other sites

Guest Abdelghani

Yes because i speak French :P in my dossier racine du forum "public_html/hooks" I did not find this file, they are "imGoogleSearch_....." and " sos32_gchovercard_search_......." :(

Edited by Abdelghani
Link to comment
Share on other sites

Guest Abdelghani

Merci beaucoup c'est a moi l'honneur :), j'utilise Social Groups v2.0.0

Edited by Abdelghani
Link to comment
Share on other sites

  • Tony unpinned and unlocked this topic
×
×
  • Create New...