Not logged in. · Lost password · Register
Forum: Support Ideas and suggestions RSS
Some new template exports
jense #1
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Subject: Some new template exports
I'd appreciate the following variables in templates (common_out.lib.php):
  1. @@ -489,8 +489,10 @@
  2.                 $tpitem['addPreSubject'] = $data['output'];
  3.  
  4.                 $tpitem['isMoved'] = $thread->IsMoved();
  5. +               $tpitem['isOwn'] = $flag_own;
  6.                 $tpitem['isClosed'] = $thread->IsClosed();
  7.                 $tpitem['isImportant'] = $thread->IsImportant();
  8. +               $tpitem['isHot'] = $flag_hot;
  9.                 if ($jmp_new)
  10.                         $tpitem['linkThread'] = $jmp_new;
  11.                 else
and
  1. @@ -2772,10 +2774,11 @@
  2.                 $page_count = ceil($count / $perpage);
  3.         else
  4.                 $page_count = 1;
  5. -       $UNB['LastPageCount'] = $page_count;
  6. +       $UNB['TP']['LastPageCount'] = $page_count;
  7.  
  8.         if ($page > $page_count) $page = $page_count;
  9.         if ($page == -1) $page = $page_count;
  10. +       $UNB['TP']['ThisPageCount'] = $page;
  11.  
  12.         if ($params['##'])
  13.         {
Note: the replacement $UNB['LastPageCount']$UNB['TP']['LastPageCount'] needs to be done at four additional places.
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
1) Done.

2) Why should that value be moved into the template parameter space? It is written to the general UNB variable space ($UNB) and read from it in other locations. From the description of the function UnbPageSelection, $UNB['LastPageCount'] is exported by this function.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #3
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
I'd like to have
        {$ItemCount} [topics|posts] (page {$ThisPageCount} of {$LastPageCount})
in my templates (conditionals omitted)...
Alala, Alala, Gimme three wishes - CSS
jense #4
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Apparently, I forgot this one in unb_lib/common_out.lib.php:
  1. @@ -2761,6 +2761,7 @@
  2.         global $UNB, $UNB_T;
  3.  
  4.         if (!$count) return '';
  5. +       $UNB['TP']['ItemCount'] = $count;
  6.  
  7.         if (!isset($params)) $params = array();
However, this only works for search results correctly (cf. http://newsboard.unclassified.de/forum/thread/1600)...
Alala, Alala, Gimme three wishes - CSS
jense #5
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Just for the record:  find attached the complete changes of (2)
Alala, Alala, Gimme three wishes - CSS
The author has attached one file to this post:
patch-5-0-features 1.7 kBytes
You have no permission to open this file.
jense #6
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Appendix:
I found that $ItemCount is more reliable than $searchResultsCount.  I regularly got search results like #N polls in the heading, however, non displayed.
Alala, Alala, Gimme three wishes - CSS
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 193.3 ms (133.8 ms) · 77 database queries in 117.4 ms
Current time: 2013-05-18, 13:11:58 (UTC +02:00)