MyBB Community Forums

Full Version: Scroller for portal. PHP content?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to make a scroller on my portal with either my latest posts, my latest photos from my gallery or latest news. I thought my easiest option would be to use something like this from Dynamic Drive but I am not sure if I could use php for the content that scrolls?

Any help would be great!
Yeah php content should work ok if have done a few plugins for e109 for my old clan using a similar script.

personally i don't like for news or latest post stuff and only use it on image based things.

Fishntassie...
Also, what is the best way for me to add php script anywhere on my portal? I cant just add it to the portal template because it is php. I have decided to make a thing which scrolls through the latest uploads in my gallery.
Wheel-World Wrote:Also, what is the best way for me to add php script anywhere on my portal? I cant just add it to the portal template because it is php. I have decided to make a thing which scrolls through the latest uploads in my gallery.

You can put PHP code in the portal.php file. If there is any output from your custom PHP code you should assign the output to a variable and call the variable through the template.
So will this work:

I am adding a latest uploads pulled from my coppermine photo gallery. The code i need to add which i know works is this:
<?php
  include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(5,1);
  $objCpm->cpm_close();
?>

So my code is:

// Latest Pics
{eval("\$latestpic = include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm(."/gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(5,1);
  $objCpm->cpm_close(););
output_page($latestpic);
}

And then i add {$latestpic} to the html portal template.

My knowledge of php is fairly limited so help would be appreciated. Sorry if this is starting to belong in code modifications.
Can anyone give me feedback on the above code? I cant get it to work. Sorry if this should be in code modification.