Graeme Leighfield Posted July 27, 2010 Posted July 27, 2010 File Name: GLC Custom Icon Per user (Similar to CONTRIBUTOR icon on IPS forums)File Submitter: Graeme LeighfieldFile Submitted: 26 Jul 2010File Category: Hooks and Plugins GLC Custom icon per userWhat this hook does This hook will allow you as admin to enter in a group of user IDs and then allocate a custom icon to be displayed underneath there profile fields in topic view. This has nothing to do with custom profile fields and/or permissions, so there is no way that users can get this icon unless you give it to them! Screenshot 1 - An example of what I used this for on my forums, I wanted a way for forum members to easily recognise whos going to a car show, so i added this icon to the name of everyone who has successfully paid for there ticket to this show. Screenshot 2 - A replication of the contributor link as seen here on the IPS forums. Screenshot 3 - ACP view, enter in the user ids seperated with a SPACE i.e "1 2 3 4 5", also shows entering code. Enjoy - donations kindly recived at sales@glcreations.co.uk :thumbsup:Click here to download this file
Ruedy Posted July 27, 2010 Posted July 27, 2010 Is only one Icon possible, or is there a way to use several ones?
Graeme Leighfield Posted July 27, 2010 Author Posted July 27, 2010 Currently its only one icon im afraid. However I would like to expand this into an application to add multiple at a later date. Just need to learn more about the application system in IPB first :rolleyes:
Ruedy Posted July 27, 2010 Posted July 27, 2010 Currently its only one icon im afraid. However I would like to expand this into an application to add multiple at a later date. Just need to learn more about the application system in IPB first :rolleyes: Okay, sounds good. Thank you!
Nuclear General Posted July 30, 2010 Posted July 30, 2010 It'd be easier and better to make it detect which users have contributed to the DL system instead of having the admin type in hundreds and hundreds of user ID numbers. Just a suggestion... -Donald
Graeme Leighfield Posted July 30, 2010 Author Posted July 30, 2010 This wsnt meant to be a like for like for the contributor thing on here. I made it for my example (please see screen shot in resources section...)
tekguru Posted October 4, 2010 Posted October 4, 2010 This has suddenly stopped working on my site, as soon as I added in IDs of 6 & 1073 - any ideas? Now no IDs work at all.
Graeme Leighfield Posted October 4, 2010 Author Posted October 4, 2010 Have you correctly spaced them? Or left white space at the end or begining?
tekguru Posted October 4, 2010 Posted October 4, 2010 Yep, and no white space at all. Tried both ways round as well as recahing the skins. Nothing seems to work!
Graeme Leighfield Posted October 4, 2010 Author Posted October 4, 2010 So putting in other id's work? Just not these numbers? Really odd???
tekguru Posted October 5, 2010 Posted October 5, 2010 Nope, it worked originally, but now I've changed the IDs it will not work for any ID number at all.
Graeme Leighfield Posted October 5, 2010 Author Posted October 5, 2010 This is odd. Try uninstalling the mod and re-installing. Im running local tests and cant seem to replicate the problem :(
tekguru Posted October 5, 2010 Posted October 5, 2010 Just done that and still no go I'm afraid. Does the attached look right? Anything else I can check and report back on?
Graeme Leighfield Posted October 5, 2010 Author Posted October 5, 2010 That looks fine!?!? I dont understand what is causing this Im afraid. Are you running a custom skin?
tekguru Posted October 7, 2010 Posted October 7, 2010 Sorted it :) It was a bad path to the graphic in the end!
Graeme Leighfield Posted October 8, 2010 Author Posted October 8, 2010 Sorted it :) It was a bad path to the graphic in the end! Phew!!! You got me seriously worries there!
tekguru Posted October 8, 2010 Posted October 8, 2010 Me too! Weird that I'd not changed the path at all but have to move it from being relative to being exact.
The_Welsh_One Posted November 10, 2010 Posted November 10, 2010 How do you get the user ID's please? :)
DZComposer Posted February 7, 2011 Posted February 7, 2011 Hmm... This isn't working for me. Re-installed it several times. I do not have a bad image URL like the previous person. I am using a custom skin, but it doesn't work on the default either. I don't know much about IPB's code, so I'm not sure how helpful this is, but a little digging seems to indicate the problem is in this function: public function replaceOutput( $output, $key ) { if( is_array($this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'][0]['post_data']) AND count($this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'][0]['post_data']) ) { $tag = '<!--hook.' . $key . '-->'; $last = 0; foreach( $this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'][0]['post_data'] as $pid => $post ) { $pos = strpos( $output, $tag, $last ); if( $pos ) { $string = $this->getPostHook( $pid, $post ); $output = substr_replace( $output, $string . $tag, $pos, strlen( $tag ) ); $last = $pos + strlen( $tag . $string ); } } } return $output; } The big if statement is returning false. Don't know if this information is helpful, but I am running a board converted from SMF 2.0RC4.
DZComposer Posted February 10, 2011 Posted February 10, 2011 I ended up having to go with a different solution.
PPlanet Posted September 25, 2011 Posted September 25, 2011 Me too! Weird that I'd not changed the path at all but have to move it from being relative to being exact. Well, it's great I thought of having a look at this thread because I had exactly the same problem overnight, after a long time of using this hook. And using a full path to the graphic solved it. Now, the possible reason for the sudden change may have something to do with the changes I did after I installed IP.SEO, those changes were (in the Search Engine optimization area of ACP): 1) Redirect to new friendly URL format set to yes 2) Changed the url type from "search string" to "path info" (I'm using Apache, so it seems to make sense) 3) Use .htaccess mod_rewrite set to yes (and I added the code snippet to my .htaccess file) 4) Log all Search Engine visits set to yes And that was it. I suspect changes 1 or 2 look like the main culprits. On a separate note, while I was trying to sort the problem out, I couldn't find a way of uninstalling the Custom Icon hook (I couldn't find it listed among my hooks... yet it's there and still working). Just out of curiosity, how do you uninstall it?
Ihia Posted October 30, 2011 Posted October 30, 2011 Is this working on 3.2 ? Its seems to be working fine, but I have a few problems on the forum, and wondering what hook it could be
Recommended Posts
Archived
This topic is now archived and is closed to further replies.