Jump to content

Peter F.

Clients
  • Posts

    1,359
  • Joined

  • Days Won

    4

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Everything posted by Peter F.

  1. My apologies, I was merely showing what I had done so that it could be copy pasted directly into the file if needs be. Ok what I have done there is taken the template inside the foreach loop and placed it inside a template function postViewTemplate($forum, $topic, $post, $displayData) Currently the section of the topicViewTemplate dealing with posts is structured like so: <if test="hasPosts:|:is_array( $post_data ) AND count( $post_data )"> <!-- skinnote: Posts by ignored users are not hidden, check _ignored --> <foreach loop="post_data:$post_data as $pid => $post"> . . Lots of post template stuff in here . . </foreach> </if> <!-- MOD LINKS --> and I changed it to this <if test="hasPosts:|:is_array( $post_data ) AND count( $post_data )"> <!-- skinnote: Posts by ignored users are not hidden, check _ignored --> <foreach loop="post_data:$post_data as $pid => $post"> {$this->postViewTemplate($forum, $topic, $post, $displayData)} </foreach> </if> <!-- MOD LINKS --> where the postViewTemplate function is structured like so: //=========================================================================== // Name: postViewTemplate //=========================================================================== function postViewTemplate($forum, $topic, $post, $displayData) { $IPBHTML = ""; //--starthtml--// $IPBHTML .= <<<EOF . . Lots of post template stuff in here . . EOF; //--endhtml--// return $IPBHTML; } This change should allow hook authors to extract post specific data from each post iteration to use in their hooks.
  2. With the foreach template hooks though you still run into the problem that you can't access any of the data that is actually used in the post itself. For example using the "foreach hook" I am not able to access the $post variable that is used in the topicViewTemplate which contains the post specific data I'm looking to use. Nor would using the "foreach hook" allow me to place the data where I want it to go in each post unless hooks are given access to the post that has been generated by the template, in which case regex could be used to perform replacements or insertions to each post on the fly using the foreach hook. But from my examinations of the IPB code this is not what happens. From what I can see this is what happens: IPB parses the topicViewTemplate for the topic. IPB then checks to see if there are any hook points that will fit in. If there are IPB parses those hook points separately and places them into the hook point. IPB then removes any hooks points that have not been used and displays the topic Additionally there is no way, that I can see, at present to make an "if hook" run separately for each post, even if the "foreach hook" is used, and thus no way for IPB to differentiate between the hook being placed in post #1 and the hook being placed in post #2.
  3. I've been trying a number of different methods to create a hook that uses post specific data to no avail. Mainly due to the fact that the topicViewTemplate contains the foreach loop within the template combined with the inability of template hooks to access any data that is used within the template itself. If there is a way to do this that I'm missing I apologise. The only way currently that I can see to get post specific data is to completely duplicate the topicViewTemplate in a skinOverloader, but that would cause problems if multiple modders wanted to use hooks in different sections of the topicViewTemplate, one skinOverloader would overwrite another. Would it be possible for the topicViewTemplate to be split into two separate templates, one for the topic as a whole and another for a post which would be called by the topic template each time it wanted to run a post. That way at least a skinOverloader could be called that could pass post specific data to a template hook to be used.
  4. I've a small suggestion to make with regards to the #show_groups# that people use in settings to display the multi_select group box. Something that has been a source of much annoyance to me for a while is that fact that the output of the shortcut is not sorted in any way at all, to remedy this I propose that the following code in '/admin/applications/core/modules_admin/tools/settings.php' be changed from: else if ( $r['conf_extra'] == '#show_groups#' ) { $this->DB->build( array( 'select' => '*', 'from' => 'groups' ) ); $this->DB->execute(); while( $row = $this->DB->fetch() ) { if ( $row['g_access_cp'] ) { $row['g_title'] .= "( STAFF )"; } $dropdown[] = array( $row['g_id'], $row['g_title'] ); } } to else if ( $r['conf_extra'] == '#show_groups#' ) { $this->DB->build( array( 'select' => '*', 'from' => 'groups', 'order' => 'g_title ASC', ) ); $this->DB->execute(); while( $row = $this->DB->fetch() ) { if ( $row['g_access_cp'] ) { $row['g_title'] .= "( STAFF )"; } $dropdown[] = array( $row['g_id'], $row['g_title'] ); } } or that a new conditional be added to detect #show_groups_asc# (to signify that the groups are sorted in ascending order) like so: else if ( $r['conf_extra'] == '#show_groups_asc#' ) { $this->DB->build( array( 'select' => '*', 'from' => 'groups', 'order' => 'g_title ASC', ) ); $this->DB->execute(); while( $row = $this->DB->fetch() ) { if ( $row['g_access_cp'] ) { $row['g_title'] .= "( STAFF )"; } $dropdown[] = array( $row['g_id'], $row['g_title'] ); } }
  5. Your best option would be then to poll your users and see what they think of it, and if they would be willing to upgrade or if they can't/won't if they would still visit the site without being able to access all of the fancy features? And honestly it depends on how much money you make off of each individual user (if any at all) or if your money is gained via advertising and the like.
  6. I would ask them to upgrade to IE7 or Firefox or Google Chrome or Opera, all of which are free. If they don't have control over installing programs on their desktop there are very good portable versions of Firefox available from portableapps.com which can run off of a USB stick or from their H drive etc. If they don't want to upgrade because they like IE6 (why I don't know) then I would suggest informing them that IE6 will no longer be supported as a browser by Microsoft in June of 2010 and that it would be in their best interest to upgrade sooner rather than later. If they still don't want to upgrade then the only thing you can do is let them know that in order to improve the site certain technologies need to be used which are unfortunately not supported by IE6 and that there will be an IE6 compatible skin but that it will not have many of the features that newer browsers would be able to support "out of the box".
  7. Joinable groups would be a good thing, but only if the admin had the option to turn it on or off on a per usergroup basis.
×
×
  • Create New...