[Solved] Best way to go about this...

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
Sy
Forum Members
Forum Members
Posts: 95
Joined: Fri Aug 17, 2007 11:13 am
Location: UK

[Solved] Best way to go about this...

Post by Sy »

I currently have news summaries showing in a side bar, however the people I'm doing the site for would like all the news articles to be in a scrolling box at the foot of the page.

I've got a nice scroller which is written in Javascript, it takes an array of items to scroll.  What I would like to do is populate this array using PHP, using one news summery per element.

I haven't done anything with CMSMS modules and I have no idea how to get the summaries out without resorting to SQL and accessing the DB myself.  I would ideally like to assign the processed templated version of the summaries so that the news inherits the template and styling as set-up using the front end.
Last edited by Sy on Mon Oct 29, 2007 11:13 am, edited 1 time in total.
User avatar
Sy
Forum Members
Forum Members
Posts: 95
Joined: Fri Aug 17, 2007 11:13 am
Location: UK

Re: Best way to go about this...

Post by Sy »

In the absence of any suggestions...what I going to do is...

Query the news from the database myself, then build an array of items which will scroll into view one after the other, hopefully I will get this done tonight and uploaded...if anyone is interested I will make the code available.
alby

Re: Best way to go about this...

Post by alby »

Sy wrote: In the absence of any suggestions...what I going to do is...

Query the news from the database myself, then build an array of items which will scroll into view one after the other, hopefully I will get this done tonight and uploaded...if anyone is interested I will make the code available.
From dynamicdrive.com I use a javascript that scroll div tag of news. This is an example

Alby
User avatar
Sy
Forum Members
Forum Members
Posts: 95
Joined: Fri Aug 17, 2007 11:13 am
Location: UK

Re: Best way to go about this...

Post by Sy »

Most of the scrolling scripts I've seen using a DIV tag that is positioned absolutely, is this script the same.  The one I have use's an inline frame which then accesses a file with the DIV tag in that, this is also positioned absolutely at 0,0, but as iframe can be positioned relatively anywhere in your doc.

The problem with this approach is that you then need to embed the news into another file, I'll take a look at the scroller you have suggested. Thanks.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Best way to go about this...

Post by calguy1000 »

why not wrap the {news} call in a div that is styled with fixed height and auto scroll.... then it just gives the div a scrollbar.

I'd have to look up the syntax for the css again but I've done it once already.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
alby

Re: Best way to go about this...

Post by alby »

Sy wrote: Most of the scrolling scripts I've seen using a DIV tag that is positioned absolutely, is this script the same.

Code: Select all

<div id="news" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed">
	<div id="vmarquee" style="position:absolute; width:99%;">
	</div>
</div>
is positioned absolutely but inner that is free relative in your layout ....

Alby
User avatar
Sy
Forum Members
Forum Members
Posts: 95
Joined: Fri Aug 17, 2007 11:13 am
Location: UK

Re: Best way to go about this...

Post by Sy »

Thanks for the help...I've got it working now, in the end I loaded the news articles using SQL and rolled them into a content array so each article scrolls up seperately, it seems to work pretty well.

http://eskajrh.demonweb.co.uk/
Post Reply

Return to “Developers Discussion”