whats the diff between Center Blocks and Frontpage Blocks ??
cmon guys please help!!!
what does this site use for the announcement abt TP on the home page ?
Quote from: Prasad007 on February 20, 2006, 04:09:21 PM
whats the diff between Center Blocks and Frontpage Blocks ??
Center blocks can be displayed when in the forum. Frontpage blocks are only displayed on the front page.
Hi gerrymo
I've got a related question - I think :-\
On my site I want to display a couple of RSS feeds, but I don't want them to appear on the front page. I can get them to work okay if I use a front page block, but I actually want to link to them from a menu selection in a front page left block. I want the RSS feeds to open in a new page in the TP theme frame.
If I define an RSS feed as a center block (not on the front page) it shows up on the front page - is there any way I can make it open in a new page? Alternatively, is there any way I can display an RSS feed in an article (I tried, but it didn't parse)?
I'm using SMF 1.1 RC2, TP 0.8.6 with TP Amber theme.
Thanks in advance for any help :)
Cheers
Gidget
I have had multiple RSS feeds working in articles, but it took some file hacking to do it. You appear to need to parse each RSS feed seperately. This example is for one I use, to customise it you will have to give each feed its own function and add the url as the backend.
In TPortal.php
<find>
function TPparseRSSnews()
</find>
<add before>
// RSS newsfeed for BBC sci-tech
function RSSbbctech()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$backend = 'http://newsrss.bbc.co.uk/rss/newsplayer_uk_edition/sci-tech/rss.xml';
$insideitem = false;
$tag = "";
$title = "";
$description = "";
$link = "";
// end
// Now to the parsing itself. Starts by creating it:
$xml_parser = xml_parser_create();
// Then setup the handlers:
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
// Open the actual datafile:
$fp = fopen($backend, "r");
// Run through it line by line and parse:
while ($data = fread($fp, 4096)) {
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
// Close the datafile
fclose($fp);
// Free any memmory used
xml_parser_free($xml_parser);
}
Then add a php article
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '<div style="padding: 5px;" class="smalltext">';
RSSbbctech() ;
echo '</div>';
Hi nokonium
Thank you very much for this :)
I edited TPortal.php as per the first code box in your post, changing the RSS function to my feed [RSSpolio()] and changing the backend to my Google news feed (http://news.google.com/news?ie=UTF-8&oe=utf8&q=polio&hl=en&output=rss).
I added a second function below that one in TPortal.php (again using all the code in your first box), for my second RSS feed [RSSpostpolio()] and changed the backend of that one to my other Google news feed (http://news.google.com/news?ie=UTF-8&oe=utf8&q=post-polio&hl=en&output=rss).
I didn't make any other changes in TPortal.php. (By the way, not being very familar with where I would find TPortal.php, I first edited the copy in smforum/Packages/TP086/Sources ::) instead of the one in smforum/Sources - silly me :))
After creating the php articles, the feeds are working :)
And now for the problem :(
The edited TPortal.php makes the headers in my left bar menu totally disappear from view (they still show up okay in Menu Manager). Bloc recently made some changes (included in his last update) to the headers because in the Amber theme they were not showing up correctly. This thread (http://www.tinyportal.net/smf/index.php?topic=2549.msg22567#msg22567) is relevant.
If I return to using the original (unedited-for-RSS) TPortal.php, the headers magically reappear.
Any ideas re what I need to do to get both RSS feeds in articles and headers? :laugh:
Also, is there a way to get any apostrophes in the feed parsed correctly, instead of appearing as ' ? (I did a Google search but much of what I found went over my head.)
Thanks again for your help so far.
Cheers
Gidget
I have it working in a default based theme, I don't have any other of Bloc's themes installed, unless it is down to something like missing a ; or } on copy and paste I'm :-\
Quote from: gerrymo on February 20, 2006, 05:19:18 PM
Quote from: Prasad007 on February 20, 2006, 04:09:21 PM
whats the diff between Center Blocks and Frontpage Blocks ??
Center blocks can be displayed when in the forum. Frontpage blocks are only displayed on the front page.
oh i see. thanks for the info! :)
i just added a frontpage block and activated it. But it isnt showing!! please help!.
but if i put it as center it shows.
but i dont want it in forum so what do i do??
please help!!!
so wats wrong please help!
Prasad007 ,
Please try to follow the Post Guide from my sig. You may get more people willing to assist you if you also follow this post http://www.tinyportal.net/smf/index.php?topic=2520.0 (http://www.tinyportal.net/smf/index.php?topic=2520.0)
okay read *parts of* it :)
but what do i do abt my prob?
I cannot be sure, there could be a setting in TP admin, for frontpage settings that you missed. Could be a bad file. Many of these types of problems are dependant on many factors, so there is no silver bullet answer. Mostly you just have to keep tring different settings.
ok ill try something and post updates
when i select "Frontpage Blocks" in "What to show on frontpage:"
its shown
but not when i select " Both forum and articles - sorted on date"
i want all...
Its only on frontpage blocks they show - not on "forum an articles". But centerblocks do show.
Hi nokonium
Quote from: nokonium on February 21, 2006, 01:18:51 PM
I have it working in a default based theme, I don't have any other of Bloc's themes installed, unless it is down to something like missing a ; or } on copy and paste I'm :-\
I'm pretty sure my copy and paste was accurate, but I've attached a copy of TPortal.php with my two RSS feeds inserted (in hopefully the right spot) in case you'd like to check it for me :)
Bloc - do you have any idea why the menu headers no longer show in the left block (although they are still in the menu manager list) when I use the attached TPortal.php rather than the default one? Do you think it's a problem related to the Amber theme, especially since nokonium says it is working with the default theme?
Cheers
Gidget
[attachment deleted by admin]
Gidget, I am flummoxed. I have put your TPortal.php file into my Fiddlers Elbow test site and added the two feeds to the menu, with a header. The header is missing in the display but present in the menu manager. So I added in my RSS feed to the same file, this also has an article and header in the menu and that displays properly.
I have been looking at it in a theme called BB test, this is a straight copy of the default theme and Our Local which is a modified default theme.
Bloc has admin privelages on this test site (if he can remember his password ;) )
Hi nokonium
Thank you very much for doing those tests on my feeds :) I'm glad (in a way) that I'm not the only one who's flummoxed :laugh:
It's starting to look like the Google feed is the cause of my problem :-\
I'm sure Bloc will solve it - he's my hero ;D
Cheers
Gidget
Hi Bloc
I was wondering whether you have had any thoughts about my vanishing headers problem (http://www.tinyportal.net/smf/index.php?topic=2948.msg24882#msg24882) yet?
As another test, I just replaced my RSS-modified TPortal.php with the original - as before, this brought the headers back. Then I put one of my RSS feeds in a front page block (instead of an article which uses the RSS-modified TPortal.php) and both the feed and the headers show up fine. So now I don't know whether the Google feed is the problem or not :-\
I hope the case of the disappearing header can be solved because I really want to use my RSS feeds in articles :coolsmiley:
Yours hopefully
Gidget
I'm pretty sure Bloc knows the the RSS feature needs much work. You'll just have to be patient I guess.
Thsi is probably down to the fact that the rss reader does not adjust 100% to feeds. I am re-writing it to be more accurate in that respect.
Hi Bloc
Well, I've fixed my disappearing headers problem - and of course it was something I'd done wrong :uglystupid2: rather than a problem with TP.
When making the RSS feed edits (that nokonium kindly gave me) to TPortal.php, I apparently started from the non-current version of the file. I suspect I edited the original copy held on my local computer rather than editing the version in use on my website. The edited copy I uploaded earlier in this thread was therefore not based on the current working version.
In going back over everything carefully today, I reverted the TPortal.php file back to the original by removing the two RSS feeds I'd inserted. When I tested this version, I found that although it should now be identical to the original, the headers did not reappear. So I Googled for a text file comparison program and downloaded WinMerge (http://winmerge.sourceforge.net/) (very easy to use). When I compared the two files I found differences between them ::)
I then edited the correct file and all is now good ;D
Apologies for wasting everyone's time, but I hope that in posting where I went wrong it might help someone else one day.
Cheers
Gidget