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: 301
  • 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]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

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

0 Members and 2 Guests are viewing this topic.

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 #40 on: June 07, 2010, 12:04:42 PM »
I'm very glad to help you figure some of this out.
With a little reading, you will be an expert in no time  :)

Speaking of experts, I think I've found out 1st bug...

The page links are not working correctly, currently there are 6 reviews, I set 4 per page, 2 per row, thus creating a 2nd page., clicking page 2 results with the 1st page still been displayed, however the address bar does change to " mysite.com/reviews??sa=news;start=4 ", to me it looks a little off, but I don't know where.

Any 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 #41 on: June 07, 2010, 12:45:17 PM »
Not me! I forgot about an already-reported bug that will be fixed in the next version of SimplePortal.  :-[
Code: (find) [Select]
$page_index = constructPageIndex($current_url . '?sa=news', $start, $limit, $per_page);
Code: (replace) [Select]
$page_index = constructPageIndex($current_url . 'sa=news', $start, $limit, $per_page);

I updated the attachment to http://simpleportal.net/index.php?topic=5248.msg33656#msg33656
« Last Edit: June 07, 2010, 12:55:56 PM 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 #42 on: June 07, 2010, 01:50:03 PM »
hmm..

I uploaded your attachment and manually checked it, for the new change.

I does not change anything, I even cleared the cache too, should it be something like " ?sa=boxynews', " etc etc

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 #43 on: June 07, 2010, 02:03:10 PM »
If your browser won't give you the new one, please do the manual edit I gave above.
 
 
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 #44 on: June 07, 2010, 02:07:14 PM »
hmmm, still no difference, however the address bar has now changed to " mysite.com/reviews?sa=news;start=4 "

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 #45 on: June 07, 2010, 05:44:47 PM »
I would expect something more along the lines of mysite.com/index.php?sa=news;start=4 or mysite.com/reviews/index.php?sa=news;start=4, depending on where your forum and portal are located.
 
I've only tested this out on one site, both with and without search-friendly URLs. I'm not seeing this problem.
 
If the page index is wrong, the problem is occcuring around
Code: [Select]
$page_index = constructPageIndex($current_url . 'sa=news', $start, $limit, $per_page);because that is where those page indices are made up.
 
My question is -- what is $current_url.
Before you click on one of the pagination links, what is the URL in the address bar?
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 #46 on: June 07, 2010, 06:50:23 PM »
The block is on a simple portal page, the page is called reviews, I have setup a .HTaccess for that, so the URL can look nice

mysite.com/index.php?page=reviews is the absolute location, where my HTaccess file has the rewrite for it to make it mysite.com/reviews

maybe this is the issue...

* johncccccc goes to test it...

And what do you know, that is the problem...

Any ideas about me having my cake and eating it too?

I would like to keep the URL rewrite for the reviews page, but I want the page links to work too, any workaround?

maybe something like
Code: [Select]
$page_index = constructPageIndex($boardurl . index.php . 'sa=news', $start, $limit, $per_page);
tried also
Code: [Select]
$page_index = constructPageIndex($boardurl . 'echo /index.php?page=reviews', 'sa=news', $start, $limit, $per_page);
no good :(
« Last Edit: June 07, 2010, 07:10:07 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 #47 on: June 07, 2010, 08:09:36 PM »
This is now hard-coded, so  it is only going to work on your portal page.
If you ever want boxynews on another page, you will have to revisit what goes in here.
Code: [Select]
$page_index = constructPageIndex($scripturl . '?sa=news', $start, $limit, $per_page);
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 #48 on: June 07, 2010, 10:48:18 PM »
That takes me to the portal page, the URL I need it to link to is

http://www.mysite.com/index.php?page=reviews;start=4

I managed to make it somewhat work in my own crude way

I got serttings.php added another var " $reviewpage = 'http://www.mysite.com/index.php?page=reviews;start=4'; "

then in boxynews.php I made $reviewpage global then changed the $currenturl page of the page index code to $reviewpage and to my amazement it actually work, would this method be efficial?

I used this code and it works perfectly

Code: [Select]
$page_index = constructPageIndex($reviewpage, $start, $limit, $per_page);
somehow removing the " 'sa=news' " completely fixed everything

EDIT 2


a bonus, no errors in log either :D

Now Finally I think were done here :)

Thanks alot!



Now for some tweaks, (to make it less of board news and more about the review board)

Read More | Write Comment,
I would like to change these too the following
Read Review | Comment on this Review.

I searched boxynews.php found "read more" changed it and nothing.. didn't find "write comment".

How would I do this?
« Last Edit: June 07, 2010, 11:20:42 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 #49 on: June 07, 2010, 11:47:20 PM »
hmmm. You probably don't need to mess around with settings.php.
Code: [Select]
$reviewpage= $scripturl . '?page=reviews;';
$page_index = constructPageIndex($reviewpage . 'sa=news', $start, $limit, $per_page);

I think you are correct, that the ";sa=news" part is not strictly necessary, as long as you've got ";start=<something>" in there. On the other hand, you don't need ";start=4;start=8" and ";start=4;start=0" in the URL.
 
This hack was necessary because SMF doesn't know about the .htaccess trick you used, so SimplePortal can't figure out how to make up the correct URL. I'm sure there is a more elegant way to figure out what the current URL is supposed to be.  I'm sure you could learn more by creating a custom php block on that page (for admin's eyes only, of course) containing only
Code: [Select]
phpinfo();
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 #50 on: June 07, 2010, 11:53:03 PM »
Im happy with it, as long as its not a security risk.

I figured out how to change the "Read More" to "Read Review", I did it right too, I added another strong to Sportal.english.php language file, then changed boxynews.php to  " $txt['sp_read_review'] "  I however cannot find the language string for "Write Comment".

Any Ideas where that is?

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 #51 on: June 08, 2010, 12:36:18 AM »
Code: [Select]
<div class="sp_right">', $return[$i]['link'], ' ',  $return[$i]['new_comment'], '</div>
and of course 'new_comment' gets set above in
Code: [Select]
'new_comment' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',

So you can change the value of $txt['ssi_write_comment'], or create another strong string.
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 #52 on: June 08, 2010, 10:02:31 AM »
I had a feeling it was that one, but I never saw the language string "Write Comment" so I was weary about changing anything

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 #53 on: June 08, 2010, 10:36:31 AM »
Remember -- anything you change in this block or in your own personal php file will stay that way through any SimplePortal and SMF upgrades.
 
Anything you change in a SimplePortal file will get lost in the next SimplePortal upgrade.
Anything you change in an SMF file *MIGHT* get lost in the next SMF upgrade.
 
It is pretty safe to test just replacing things within this function, because it won't affect anything about SMF or SimplePortal works.
 
So I would recommend just putting your changes in the block or in the boxynews file.
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 #54 on: June 08, 2010, 02:41:00 PM »
what about creating a reviewspage.english.php file and add that, then add my language strings there for the entire boxynews.php ?

This way I can do it right and keep it after upgrades. (I think)

I found the "Write Comment" part for now its hard coded in the boxynews.php file, I may do the above in the future, although appearance-wise there will be no difference...

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 #55 on: June 08, 2010, 03:53:50 PM »
Because boxynews.php is only meant to be used for one block on one forum, and because you don't intend to package it up as a mod to share with others, I would recommend keeping things as simple as possible.
 
If it were me, I would put all the boxynews stuff into one file.
 
If you want to rename the file to "reviewsblock.php", and rename the function to "sp_reviewsblock" to help you keep track of it, go ahead.
Whatever keeps it simple and easy to keep track of.
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 #56 on: June 08, 2010, 05:56:59 PM »
Yea, that sounds easier, after all this work making it right I would like to add the CSS changes also in the file or in the block code, how can we do this, to make it even more simpler for future use?

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 #57 on: June 08, 2010, 07:19:31 PM »
The easiest thing to do with CSS changes is to put them into portal.css and keep good notes.
 
They cannot go into the file or into the block code, unfortunately. That is because they have to linked/loaded between the <head></head> tags, which have long been closed by the time the block output is called.
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 #58 on: June 08, 2010, 07:33:35 PM »
Darn, oh well, I guess that's as simple as it can get then,

Well for now, I think this is complete

Now to see whether its fit for a future additional block for the simple portal team to use.

It would be down to you though, after all, you created the whole thing lol.

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 #59 on: June 08, 2010, 07:51:30 PM »
Well, it is available on this thread for anyone who wants it.
 
If you think it is a valuable feature, you are welcome to re-post the code and the suggestion to the feature request board. But since there aren't a ton of users begging for information on how they can use this block, I doubt it is going to get added.  If I were clever and had a bit of extra time, I'd learn how to package it up into a mod.  But I'm not going to do that now.  In about a week, I'm afraid I'm going to run out of time to help at SimplePortal.
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?