TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 01:05:55 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 147
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 70
  • Total: 70

Few blocks from TP causing my site to eat resources.

Started by Ricky., December 14, 2007, 07:26:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ricky.

Hi, I was discussing this topic in SMF forum that my smf is eating a lot of resources.
Anyways, last night I just came to know that my INDEX page ie. TP index page is taking almost 5x more time in generation than any other becasue it has "RSS" blocks.

I used those RSS blocks to present latest 12 topics and its really useful. 1 is for same site and other is from other smf website running on same server.

Last night page creation time went high to 30 seconds.. woaah..
When I disabled both rss block.. it went down to 0.23 secs.

So, wht I am supposed to dO?
All I want to include latest topic started on front page with their actual URL but not url pointing to latest post on that topic.

Any idea.. how do I decrease server load in this case without sacrificing "Latest Topics STarted block" ?

PS: site is http://www.yoindia.com/shayariadab/

Zetan

I'm not sure why you are using RSS to pull information from around your site into a place of choice.
RSS should be used sparingly and is really meant for external content.

Have you looked into using SMF's built in SSI functions? There are many Block Code Snippets that can likely do what you need, additionally you can find examples of SSI functions on your own website.

http://yoursite.com/ssi_examples.php

and

/ssi_examples.shtml

Also try searching, you'll find many topics both here and at SMF about SSI.

Ricky.

#2
Hi,

I did gave extensive look on various options available.
Also looked into SSI from SMF.

SSI do have latest post function but problem is that its showing board also but I simply by one by one list of latest topics .Another poblem is that it leads to latest reply on that topic but I want it go to topic only..
Eg.
from

It leads to :
http://www.simplemachines.org/community/index.php?topic=210979.msg1342866;topicseen#new

But I want :
http://www.simplemachines.org/community/index.php?topic=210979.0

Here is SSI.php example from smf website itself.

Zetan

The title of this topic is misleading.. "Blocks from TP..."
Actually, from what you are saying, it's the Content Within the blocks that are causing the problem, not TP itself.

Have you actually looked in the Snippets board? I'm sure SSI can be used to do what you need, even if that means making a Request for some code to be altered.

G6Cad

Also want to add that RSS is something Bloc is working on to improve a bit more, it have some faults but will get better.
As ZTN say, there are snippets with both SSI and also PHP that will give you your content you have now with RSS

Ricky.

Ya I meant to say that "Content from some block in TP".

Well, I gave really good time to look into solution already given there. Well, again.. I am not able to find something similar.

All I need "list of latest 15 topics" with URL leading to real topic but not to latest post on that topic.

So, any idea in mind as in snippet section, was not able to find one!

Smoky Blue

QuoteAll I need "list of latest 15 topics" with URL leading to real topic but not to latest post on that topic.

that comes with tp automatic.. look in your block setting and set it up that way.. no need for a snippet or anything.. altho i have mine set to last 3 posts.. hope that helps ;)

Ricky.


Smoky Blue

didnt you just ask for the latest?? recent is close Ricky, but if you really want to get into a code for a mod to do the same thing, go for it  :D

bloc

You can use ssi..but you need to extract what you need and show only that. Normally a pre-defined layout is provided for ssi_recentTopics, but that can be changed. Something like..


global $settings, $scripturl, $context, $txt;

$what= ssi_recentTopics(8, NULL, 'array');

echo '
<table border="0" class="ssi_table">';
foreach ($what as $post)
echo '
<tr>
<td valign="top">
<a href="', $post['href'], '">', $post['subject'], '</a>
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
</td>
</tr>';
echo '
</table>';




This only shows subject/link and if its new unread posts in it, no board and no author/time. Put it in a PHP block.