collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 802
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Something that can list all topics in a board  (Read 35366 times)

0 Members and 1 Guest are viewing this topic.

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Something that can list all topics in a board
« on: April 18, 2010, 11:14:16 PM »
I would like a block that will list all topics that are in a given board with links to the topic of course.

The idea is to make the portal and forum more into each other by adding some boards topics linked on a simple portal page or block.

Thanks in advanced.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Something that can list all topics in a board
« Reply #1 on: April 19, 2010, 02:52:13 AM »
Well, the BoardNews and Recent block types already allow you to do this, just only set a single board to be shown by them.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #2 on: April 19, 2010, 09:26:24 AM »
Well, the BoardNews and Recent block types already allow you to do this, just only set a single board to be shown by them.

Arhh, ok.

The recent block type seems to be the closest, but it only displays recently posted topics.

Let me be more detailed on what I'm doing here, I will be using this for a game review area in the forum, I already have setup a form (custom forms mod) to get uniform posts when adding reviews, I would like to list the reviews on a page away from the forum, and when clicked then the viewer will be directed to the post. A little example of what I mean is below.

A simple portal custom page with custom PHP block inside would:



Sakura Wars: So Long My Love Review for PS2  - The topic subject (with link to topic) (possibly "by AUTHOR" here too)
possibly a  thumbnail for the review
Every review starts with an image of the box, as controlled by the custom forms mod.

Something that lists all topics like that would be great, thanks in advanced

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #3 on: April 20, 2010, 01:19:54 PM »
I don't mean to be a bother..

My game review section of the form just needs this one block, in the above post, Ive used the custom forms mod to make a post output for the review, so there always the same layout, also the board is "reply only", so the only way to add a review is via the form mod.


That's the form, this is the output:



I also have a reviews tab I added to my form, then linked it to a simple portal page, which is where I want the above block, to make a true section, not just another board.



At this time The staff are manually adding these review links there, With this block, I would just add the block and it will do this automatically.

Thanks again..

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #4 on: April 20, 2010, 08:00:41 PM »
Are you not getting enough posts in the recent topics block?
 
Would an articles block do what you want?
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #5 on: April 20, 2010, 08:29:09 PM »
Are you not getting enough posts in the recent topics block?
 
Would an articles block do what you want?

It would be similar to an articles block, but it would display as I have posted above, instead of listing some characters, it would just get the 1st image, and resize it, to thumbnail size then display it in the area.

Then of course the text would be there too with a link to the actual review

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #6 on: April 20, 2010, 08:51:27 PM »
Have you tried the [cutoff] tag? You could put it right after the image.

 
--------------------
edit: put nobbc tag around [cutoff]
« Last Edit: April 21, 2010, 09:16:32 AM by AngelinaBelle »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #7 on: April 21, 2010, 08:59:01 AM »
Have you tried the  tag? You could put it right after the image.

There is a cutoff tag?

I did not know that, If I add that at the end of the image, the article will include it?

Have you got the PHP code that creates the article block, so I can customize it?


Damn, I need to update SP in order to take advantage of this cutoff tag, will do that and reply back see how it works


Thanks.
« Last Edit: April 21, 2010, 09:03:59 AM by johncccccc »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #8 on: April 21, 2010, 09:14:52 AM »
I do recommend using the latest release of SimplePortal.  There has been continuous improvement.
 
The [cutoff] tag is very good.  It works with BoardNews (found in PortalBlocks.php) and with portal-page articles display (see PortalArticles.php).  Since these files are all in the zip file, you can get the download and have a look through it even before you do the upgrade.
 
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #9 on: April 21, 2010, 02:19:17 PM »
I do recommend using the latest release of SimplePortal.  There has been continuous improvement.
 
The [cutoff] tag is very good.  It works with BoardNews (found in PortalBlocks.php) and with portal-page articles display (see PortalArticles.php).  Since these files are all in the zip file, you can get the download and have a look through it even before you do the upgrade.

I tried to update, but my admin area is very messy with the new 2.3.2 version (gone back to 2.3.1 for now, made support topic too)

Articles option is no good, the idea is when someone posts in that board, it will be automatically linked in the custom page.

Board news option works great, however presentation is not so well, even with the cutoff point tag (I tried while I had 2.3.2 installed).

This image is heavily zoomed out, so you can see it all

I would like several columns and rows, this option only gives me one, I also cannot remove the title or body either

I think I'm running out of options here...

Any other Ideas?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #10 on: April 21, 2010, 02:52:31 PM »
First, I thought BoardNews with cutoff might make this a support question.
Now, I think your request is in the correct place. I hope an experienced customizer picks this up.
Here is what I think you've said you want:
 
  • BoardNews content, controlled by [cutoff] tag.
  • Gallery-style display, with perhaps 4-5 blocks per row.
  • Initial image sized appropriately
  • With appropriate "gallery-like" subject and body formatting.
  Requirement 2. is where the coding comes in -- replacing the BoardNews logic with gallery-display-like logic, and mashing each post into an identical box. I hope a good customizer picks this up for you.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #11 on: April 21, 2010, 03:53:12 PM »
First, I thought BoardNews with cutoff might make this a support question.
Now, I think your request is in the correct place. I hope an experienced customizer picks this up.
Here is what I think you've said you want:
 
  • BoardNews content, controlled by [cutoff] tag.
  • Gallery-style display, with perhaps 4-5 blocks per row.
  • Initial image sized appropriately
  • With appropriate "gallery-like" subject and body formatting.
  Requirement 2. is where the coding comes in -- replacing the BoardNews logic with gallery-display-like logic, and mashing each post into an identical box. I hope a good customizer picks this up for you.

Took the word right out of my mouth;

 
  • BoardNews content, controlled by [cutoff] tag. YES
  • Gallery-style display, with perhaps 4-5 blocks per row. YES
  • Initial image sized appropriately - YES (thumbnail size images, captured with cutoff tag)
  • With appropriate "gallery-like" subject and body formatting. - YES
  • Also - Gets all topics in a given board, possibly sorted alphabetically, by subject.


In the meantime, Which files would I combine and mix and match to try and create this myself, I'm somewhat familiar with PHP code, I have written a few simple mods for the modsite.

Thanks!
« Last Edit: April 21, 2010, 04:08:39 PM by johncccccc »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #12 on: April 21, 2010, 06:46:16 PM »
You can find all the pre-defined blocks in PortalBlocks.php
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #13 on: April 25, 2010, 12:11:33 PM »
You can find all the pre-defined blocks in PortalBlocks.php

I'm not doing very well at making my own custom block...  :(

shameless bump...

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #14 on: May 01, 2010, 12:36:05 PM »
A few more days has gone by, I'm trying and failing to create this custom block myself...

How do you guys do this crazy stuff...

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #15 on: May 03, 2010, 10:48:49 AM »
I am not a customizer. But here's how I would approach it.
Since you want to work with boardnews, I'd start with sp_boardnews.
1) Copy the function sp_boardnews into a text editor, like notepad, notepad++ or frontpage. Give it a new name.  Like sp_boxynews, for example
 
2) At the very end of the block, after the closing } of the function, call the function:
 
Code: [Select]
$boxy_params = array(
      'board' => 1,
      'limit' => '',
      'start' => '',
      'length' => '',
      'avatar' => '',
      'per_page' => '12',
      'per_row' => '3',
   );

sp_boxynews($boxy_params, 0);

3)  Copy the contents of your text editor into a custom php block. Test. Edit one line in the text editor. Copy the whole thing back into the custom php block.  Repeat.
 

4) Here are a some changes you will have to make to get boxes going across.
Below, I show examples using new CSS classes that you can style in portal.css.  You could also choose to use inline styling while you are testing.
Code: (find) [Select]
  $block_parameters = array(
'board' => 'boards',
'limit' => 'int',
'start' => 'int',
'length' => 'int',
'avatar' => 'check',
'per_page' => 'int',
); 
Code: (replace) [Select]
  $block_parameters = array(
'board' => 'boards',
'limit' => 'int',
'start' => 'int',
'length' => 'int',
'avatar' => 'check',
'per_page' => 'int',
'per_row' => 'int',
);

5) Add in the logic to display several posts in a row across the  page
 
Code: (find) [Select]
  foreach ($return as $news)

 
Code: (replace) [Select]
   echo '
               <table class="sp_boxynews_container">
      ';
      $num_in_row = 0;
      foreach ($return as $news)
      {
         $num_in_row++;
         if ($num_in_row == $per_row)
         {
            echo '
               </tr>
            ';
            $num_in_row = 1;
         }

         if ($num_in_row == 1 )
         {
            echo '
               <tr>
            ';
         }
   
   echo '
      <td>
';

6) Remember to echo </td>, and at the end of the foreach loop block of code, remember to echo a </table> to close your HTML table.

7) Start changing how all that stuff is put inside each boxynews box. Remember to change only one line or two at a time, until you get it the way you want it.
 
If you have more specific questions, you can keep asking here.
Good Luck and have fun!
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #16 on: May 07, 2010, 12:20:08 PM »
Thanks, that has in-sighted me a lot, I should be able to manage that, I will post back for more support if needed and progress :)

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #17 on: May 10, 2010, 09:04:51 AM »
Hi back again...

Im getting a parse error, its on the last line, I have confirmed this with a PHP writing app, which underlines (like spell checkers) where unexpected chars (parse errors) are present, its right at the end, the very end...

Code: [Select]
<?php
$boxy_params 
= array(
'board' => 'boards',
'limit' => 'int',
'start' => 'int',
'length' => 'int',
'avatar' => 'check',
'per_page' => 'int',
'per_row' => 'int',
);

sp_boxynews($boxy_params0);
   echo 
'
               <table class="sp_boxynews_container">
      '
;
      
$num_in_row 0;
      foreach (
$return as $news)
      {
         
$num_in_row++;
         if (
$num_in_row == $per_row)
         {
            echo 
'
               </tr>
            '
;
            
$num_in_row 1;
         }

         if (
$num_in_row == )
         {
            echo 
'
               <tr>
            '
;
         }
   
   echo 
'
      <td>
'
;

?>

\
never mind, I got it, I think...

needed to close the 1st { added another } to the end

Code: [Select]
         }}
   
   echo '
      <td>
';

?>

EDIT:

OK now we got that sorted, With no parse errors, related to errors stated above anyway, Im still having issues, I have fatal errors, including PortalBlocks.php, Do I need to add this code to PortalBlocks.php too? ???
« Last Edit: May 10, 2010, 09:17:51 AM by johncccccc »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #18 on: May 10, 2010, 09:26:37 AM »
There is no reason to add this code to PortalBlocks.php.
The fragment of code you show does not not include most of what the original subroutine does.  You are asking it to show the contents of $news, for example, but there is nothing in $news (according to the fragment you are showing).
 
Is this the entire subroutine you are trying to use?
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline johncccccc

  • Jr. Member
  • **
  • Posts: 92
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Something that can list all topics in a board
« Reply #19 on: May 10, 2010, 10:13:33 AM »
I'm lost, I thought I could manage it, guess not lol

I think I'm not adding the function at the end like you said above..

Quote
2) At the very end of the block, after the closing } of the function, call the function:

Maybe this is the problem...