Welcome to Geeklog Thursday, November 23 2017 @ 11:54 am EST


Status: offline

sakuny

Forum User
Junior
Registered: 05/02/2004
Posts: 29
Quote by ronack: It just means that you can put a static page in your the center. However now with this putting a feed in the center is super.

Now I just tried something and that was to try and put 2 RSS feeds in one center block side by side or in line one below the other. It didn't work for some reason.


I understand that this script puts and RSS feed in the center block, but if you look at the earlier post by Gaving and see his site at: Ould Sod then you'll see what I mean about putting other blocks in the center. He also uses tables to put multiple blocks. (Did you try inserting the code into tables to get more than one RSS feed?)

On the front page of Geeklog, the Forum block is in the center. I'm assuming this is a staticpage being used somehow.


Status: offline

samstone

Forum User
Full Member
Registered: 29/09/2002
Posts: 820
I just posted a reply right before your post that has to do with part of your question. Ould Sod has a stack of RSS feed in his staticpage.

Other than that the weather is a link from a weather site. It is not a center block of the GL weather block. All you need is to get the code from the weather site and drop it in.

The random photo is from the gallery. I don't know how he coded it in, but if I had to do such thing, I would use the method posted at this link.

The point is there is no one size fit all code for you to put everything you want in the static page, you have to find a way to do for each individual case.

As for the forum center block, it has nothing to do with the staticpages, it was part of the forum features.

Sam

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
Posts: 13073
Location:Stuttgart, Germany
Quote by sakuny: On the front page of Geeklog, the Forum block is in the center. I'm assuming this is a staticpage being used somehow.

No, that's a feature of the forum plugin.

Currently, only plugins can display content in center blocks (that's how static pages can be displayed in a center block in the first place ...).

bye, Dirk

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/2002
Posts: 820
Just corrected my reply to Ronack.

Status: offline

jbpaul17

Forum User
Chatty
Registered: 14/05/2004
Posts: 49
Location:New York City
determined
All,

I appreciate all the followups on this topic, but my question still remains... I'm getting the error message:
Fatal error: Call to undefined function: static_rdf() in /home/jeffand/public_html/staticpages/index.php(84) : eval()'d code on line 1

And can be viewed at:
http://jeffandcrystal.com/staticpages/index.php?page=ESPN

I've set up a static page with the following code within it (20 being the code for the portal block previously created for the non-enabled ESPN RSS feed):
$return = static_rdf('20'); return $return;

I have not allowed the static page to wrap text, I've selected the "execute PHP" (not "execute PHP (return)") option, and not selected the "Exit Type" option.

I've pasted the appropriate code within /public_html/system/lib-custom.php. However, I still can only manage to ge the above mentioned error message. Any thoughts?

Any assistance would be greatly appreciated, thanks!
Jeff.

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/2002
Posts: 820
Make sure that the code is correctly pasted in. The error says that the static_rdf is not defined. Have you tried "echo static_rdf('20');"?

I've pasted the appropriate code within /public_html/system/lib-custom.php.


It is quite unusual for me to see the 'system' folder in the 'public_html' instead of "Geeklog" directory. I see all your system files by going there.

Sam

Status: offline

sakuny

Forum User
Junior
Registered: 05/02/2004
Posts: 29
Quote by samstone: I just posted a reply right before your post that has to do with part of your question. Ould Sod has a stack of RSS feed in his staticpage.

Other than that the weather is a link from a weather site. It is not a center block of the GL weather block. All you need is to get the code from the weather site and drop it in.

The random photo is from the gallery. I don't know how he coded it in, but if I had to do such thing, I would use the method posted at this link.

The point is there is no one size fit all code for you to put everything you want in the static page, you have to find a way to do for each individual case.

As for the forum center block, it has nothing to do with the staticpages, it was part of the forum features.

Sam


aaah, thanks so much for giving me a more complete understanding to work with.
now i can tinker with it myself and figure out which items i can get to display there.


Status: offline

drshakagee

Forum User
Full Member
Registered: 01/10/2003
Posts: 231
The code for the static page on theouldsod.com is:
PHP Formatted Code

$display .='<div style="float:left; margin:5px; width:45%;">';
$display .= COM_startBlock ('Random Sod Shot');              
$display .= phpblock_galleryRandomPhoto();
$display .= COM_endBlock();
$display .= COM_startBlock ('Latest Sod News');
//$display .= phpblock_phpicalendar();
$display .= static_rdf('18');
$display .= COM_endBlock();
$display .= COM_startBlock ('Weather at the Sod');
$display .= '<div class="jetbarweather"><a href="http://www.jetbar.com/cgi-bin/weather/hw3.cgi?zipcode=92116" target="_blank"  title="Click for full forcast"><img src="http://www.jetbar.com/cgi-bin/weather/hw3.cgi?config=png&zipcode=92116&alt=hwicc" border="0" alt="Current weather at the Sod."></a><br/>Weather by <a href="http://www.jetbar.com/">Jetbar</a></div>';
$display .= COM_endBlock();
$display .='</div>';
$display .='<div class ="alllists">';
$display .= COM_startBlock ('Tonight at the Sod');  
$display .= static_rdf('17');
$display .= COM_endBlock();
$display .= COM_startBlock ('This week at the Sod');  
$display .= static_rdf('15');
$display .= COM_endBlock();
$display .= COM_startBlock ('San Diego Sports');  
$display .= static_rdf('30');
$display .= COM_endBlock();
$display .='</div><div style="clear:both;"></div>';
return $display;

 

Also you can do things like showing the user functions block like:
PHP Formatted Code

$display .= COM_showBlock( user_block, $help='', $title='User Functions' );

 

If you find out the block names you can show all sorts of other blocks (not all blocks work though).

Gavin
Yes I am mental.

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/2002
Posts: 820
Thanks for sharing you codes, Gavin. PHP just become more and more interesting to me, so I decided to learn it. Maybe I will become good enough to help the GL team.

One question I have, which is not related to GL here, is the use of "echo" vs. "$display" What's the main difference? I tend to run into error with "$display," so I prefer to use "echo." I know this is not a php lesson site, but just can't withhold my curiousity.

I am about to try getting the events list in the center block. I wonder if you have already tried that and ended up using phpicalendar because having RSS makes things easier.

Happy New Year!

drali

Anonymous
just a note:

if you wanna put in the code for the center block as samstone suggests, you need to have 'EXECUTE PHP (RETURN)' selected.

if you want to make it show with just 'EXECUTE PHP'...
then you need teh following code:

PHP Formatted Code
echo static_rdf('49');

 


can someone explain this to me further? it works yah...but umm...i need more info. i get scared when things work that i dont totally understand.

the good thing about this version, is that it lets me easily add more text to the return via additional echo statements. before if i added teh echo statements, it would show up ABOVE my page header. yah.

thanks TONS for getting this to work tho! i've been trying to get something like this for more than a year now!! you've made my dreams come true. haha.

Status: offline

greenhil

Forum User
Chatty
Registered: 20/07/2004
Posts: 51
Thanks for the code from the home page of oldsod

everything is working fine except for i am not getting two columns...i assume it is
$display .='';

i assume i need to add some code somewhere else for this to call properly?

Mary Simms

Anonymous


This is very interesting. I tried MyNewsheadlines, but found it rather confusing. Your script works well. I have only one question. How do you limit the amount of feeds to be displayed?

Status: offline

drshakagee

Forum User
Full Member
Registered: 01/10/2003
Posts: 231
Quote by greenhil: Thanks for the code from the home page of oldsod

everything is working fine except for i am not getting two columns...i assume it is
$display .='';

i assume i need to add some code somewhere else for this to call properly?


I think in my style.css file I have the "alllists" class defined to have float:right which give its the two columns.

Yes I am mental.

Status: offline

drshakagee

Forum User
Full Member
Registered: 01/10/2003
Posts: 231
Quote by Mary Simms:

This is very interesting. I tried MyNewsheadlines, but found it rather confusing. Your script works well. I have only one question. How do you limit the amount of feeds to be displayed?


When you create a new feed in the content syndication section of the admin panel you can limit the number of items to display in each feed, is that what you mean?
Yes I am mental.

Status: offline

geKow

Forum User
Full Member
Registered: 12/01/2003
Posts: 445
I also try to "steal" your idea, but I can't get my rdf feeds running in a centerblock that way. It tells me:

Something is wrong with the blockid that you entered. Fix this. Otherwise there could be issues

* Block is not of Portal Type

Status: offline

drshakagee

Forum User
Full Member
Registered: 01/10/2003
Posts: 231
Quote by geKow: I also try to "steal" your idea, but I can't get my rdf feeds running in a centerblock that way. It tells me:

Something is wrong with the blockid that you entered. Fix this. Otherwise there could be issues

* Block is not of Portal Type


That is the error you will get if you try to pass the static_rdf function a block id that isn't a portal block. Double check the block id of your portal block and make sure to put that id in the function call here: static_rdf('##'); The ##'s should be replaced with the block id of your portal block.
Yes I am mental.

Status: offline

geKow

Forum User
Full Member
Registered: 12/01/2003
Posts: 445
ahhh I thought I need the feed ID, but I need to have a real block. Now I know
thx

Status: offline

drshakagee

Forum User
Full Member
Registered: 01/10/2003
Posts: 231
Oh now I understand, yeah you need to create a standard portal block first then uncheck the enabled box, then pass that block id to the static_rdf function. Sorry I didn't realize what you meant.
Yes I am mental.

ishmot

Anonymous
Works great on my site! Thank you very much!


All times are EST. The time is now 11:54 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content