phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Small issue - adding something into TOPICS separator on VF


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
JLA
Board Member



Joined: 30 Apr 2009

Posts: 368
Location: U.S.A


flag
PostPosted: Wed Sep 30, 2020 2:34 pm 
Post subject: Small issue - adding something into TOPICS separator on VF

Having a slight issue. Trying to add a pagination tag on the topics separator (from includes/functions_separate.php and viewforum.php) Was thinking in viewforum when working with $dividers and viewforum_body.tpl (using template mod) that it could be done there. Tried various things in the template like <?php if($dividers_i = $lang['Topics']) { which works for forums that only have topics and no sticky or announcements topics but with those that do, then the pagination shows up on each divider row since when you print"$dividers_i"; each line shows as $lang['Topics'] for those with multiple dividers.

Not sure what I am missing.... Any ideas???

Here is code from functions_separate

Code:

function get_dividers($topics)
{
   global $lang;

   $dividers = array();
   $total_topics = count($topics);
   $total_by_type = array (POST_GLOBAL_ANNOUNCE => 0, POST_ANNOUNCE => 0, POST_STICKY => 0, POST_NORMAL => 0);

   for ( $i=0; $i < $total_topics; $i++ )
   {
      $total_by_type[$topics[$i]['topic_type']]++;         
   }

   //if ( ( $total_by_type[POST_GLOBAL_ANNOUNCE] + $total_by_type[POST_ANNOUNCE] + $total_by_type[POST_STICKY] ) != 0 )
   //{
      $count_topics = 0;
      
      $dividers[$count_topics] = $lang['Global_Announcements'];
      $count_topics += $total_by_type[POST_GLOBAL_ANNOUNCE];

      $dividers[$count_topics] = $lang['Announcements'];
      $count_topics += $total_by_type[POST_ANNOUNCE];

      $dividers[$count_topics] = $lang['Sticky_Topics'];
      $count_topics += $total_by_type[POST_STICKY];

      if ( $count_topics < $total_topics )
      {
         $dividers[$count_topics] = $lang['Topics'];
         //$dividers[$count_topics] = '';
      }
   //}

   return $dividers;
}


Was able to add this on our viewrecent index since only the topic divider appears there. http://www.jlaforums.com/viewrecent.php You can see the pagination in the topic divider row. viewrecent never displays sticky topics or normal announcements so those divider rows are never brought up.

_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 368
Location: U.S.A


flag
PostPosted: Fri Oct 02, 2020 7:58 pm 
Post subject: Re: Small issue - adding something into TOPICS separator on

Anyone have any ideas?

Thanks in advance.

_________________
http://www.jlaforums.com
Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 206



PostPosted: Mon Oct 05, 2020 10:22 am 
Post subject: Re: Small issue - adding something into TOPICS separator on

I can't seem to access viewrecent.php, even if I answer the security question.
_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 368
Location: U.S.A


flag
PostPosted: Mon Oct 05, 2020 3:50 pm 
Post subject: Re: Small issue - adding something into TOPICS separator on

Sorry Vendethiel. Seems as you must be running a unique configuration. I see your attempt to access but not 100% clear why you were denied. Perhaps we can do a quick troubleshoot via PM incase it is a problem on our end?

In the meantime, here is a screen shot of the viewrecent page that shows the area I'm speaking of.



hethe.jpg
 Description:
 Filesize:  55.63 KB
 Viewed:  40 Time(s)

hethe.jpg



_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 368
Location: U.S.A


flag
PostPosted: Mon Oct 05, 2020 7:28 pm 
Post subject: Re: Small issue - adding something into TOPICS separator on

BTW - just realized that seems can't send you a PM....
_________________
http://www.jlaforums.com
Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 206



PostPosted: Tue Oct 06, 2020 9:33 am 
Post subject: Re: Small issue - adding something into TOPICS separator on

I think PMs have been disabled here.
_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 368
Location: U.S.A


flag
PostPosted: Tue Oct 06, 2020 12:33 pm 
Post subject: Re: Small issue - adding something into TOPICS separator on

Vendethiel wrote:
I think PMs have been disabled here.


Alternate contact??

Btw - did you see the screenshot?

_________________
http://www.jlaforums.com
Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 206



PostPosted: Wed Oct 07, 2020 4:08 pm 
Post subject: Re: Small issue - adding something into TOPICS separator on

I thought we had communicated via email already? I'm not sure if I can find your email again.

I looked at the code, but that's not a standard phpBB2 feature (viewrecent.php I mean) and it's not in any premod I have uploaded, so I can't help you much more.

_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 368
Location: U.S.A


flag
PostPosted: Wed Oct 07, 2020 4:20 pm 
Post subject: Re: Small issue - adding something into TOPICS separator on

Viewrecent is at core same as viewforum excepts pulls data for recent topics/posts consolidated. The topic dividers works in the same way as on viewforum except on viewrecent there are no sticky topics or normal announcements.

Just looking to add our pagination tag into the "Topics" divider line on viewforum but unfortunately having difficulty because of the view forum uses sticky and announcements and something going on in functions_separate is preventing using same method as on viewrecent due to the sticky topics and announcements divider rows.

Does this info help?

Email is info@jlaforums.com

Thanks!

_________________
http://www.jlaforums.com
Back to top
lumpy burgertushie
Board Member



Joined: 19 Nov 2008

Posts: 251


flag
PostPosted: Wed Oct 14, 2020 3:29 am 
Post subject: Re: Small issue - adding something into TOPICS separator on

don't mean to butt in here but I can't find anything named functions_separate or viewrecent anywhere in phpbb2
I assume these are things that you have created for your board or a MOD you have installed etc.


robert
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 368
Location: U.S.A


flag
PostPosted: Wed Oct 14, 2020 8:55 pm 
Post subject: Re: Small issue - adding something into TOPICS separator on

lumpy burgertushie wrote:
don't mean to butt in here but I can't find anything named functions_separate or viewrecent anywhere in phpbb2
I assume these are things that you have created for your board or a MOD you have installed etc.


robert


Viewrecent is our creation - but same as viewforum but only for recently added topics.

And now realizing yes, it is a mod (the topic dividers) must have been installed long ago.

Code:

##############################################################
## MOD Title: Separate Announcements & Sticky
## MOD Author: Aiencran < cranportal@katamail.com >
## MOD Description: This hack separates Announcements and Sticky Topics from other topics in viewforum page.
## MOD Version: 2.0.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit: viewforum.php,
##        language/lang_english/lang_main.php,
##        templates/subSilver/viewforum_body.tpl
## Included Files: includes/functions_separate.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
##   2005-03-15 - Version 2.0.0
##      - Announcements and Sticky Topics are separated
##   - Sticky Topics are shown only in the first page (original behaviour)
##
##   2004-10-27 - Version 1.1.0
##      - It supports now Global Announcements
##   - Fixed sorting issues
##
##   2004-10-20 - Version 1.0.0
##      - First Version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------
#
copy includes/functions_separate.php to includes/functions_separate.php

#
#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------
#
include($phpbb_root_path . 'includes/functions_separate.'.$phpEx);

#
#-----[ FIND ]------------------------------------------
#
$total_topics += $total_announcements;

#
#-----[ AFTER, ADD ]------------------------------------
#
$dividers = get_dividers($topic_rowset);

#
#-----[ FIND ]------------------------------------------
#
   'U_VIEW_TOPIC' => $view_topic_url)
);

#
#-----[ AFTER, ADD ]------------------------------------
#
if ( array_key_exists($i, $dividers) )
{
   $template->assign_block_vars('topicrow.divider', array(
      'L_DIV_HEADERS' => $dividers[$i])
   );
}

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------
#
$lang['Global_Announcements'] = 'Global Announcements';
$lang['Announcements'] = 'Announcements';
$lang['Sticky_Topics'] = 'Sticky Topics';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN topicrow -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN divider -->
<tr>
   <td class="catHead" colspan="6" height="28"><span class="cattitle">{topicrow.divider.L_DIV_HEADERS}</span></td>
</tr>
<!-- END divider -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#



So we are inserting pagination on the "Topics" divider row created by that mod. You can see all of the rows on one of our forum pages here (announcements, sticky and topics)

http://www.jlaforums.com/viewforum.php?f=60

and here only topics and sticky topics
http://www.jlaforums.com/viewforum.php?f=9

_________________
http://www.jlaforums.com
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0283 seconds using 17 queries. (SQL 0.0020 Parse 0.0024 Other 0.0240)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo