How to have 2 news side by side?
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please
Author Message
medigangsta
Nice poster


Joined: Jul 16, 2004
Posts: 69

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Apr 23, 2005 5:41 pm
Reply with quote

Right, I've nearly got a second added, but can't quite get it right, I'll post the code up to see if someone else can get it sorted, as I may not look at it again tonight.

Code:
<!-- DEFINE $LEFT_ARTICLE = false -->
<table align="center"><tr>
<!-- BEGIN newstopic -->
<td width="50%">
<a href="{newstopic.U_NEWTOPIC}"><img src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" /></a>
<span class="legend">{newstopic.S_TITLE}</span>
  <font size="2" color="#000000">{newstopic.S_STORY}
  <!-- IF newstopic.S_NOTES -->
  <br /><br /><b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i>
  <!-- ENDIF -->
  </font><br />
  <font size="1" color="#035D8A">{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_TIME}</font>
  <div align="right"><span class="storyfoot">{newstopic.S_MORELINK}</span></div>
</td>
  <!-- IF $LEFT_ARTICLE -->
    </tr></table><table><tr><td><!-- DEFINE $LEFT_ARTICLE = false --></td>
  <!-- ELSE -->
    </tr><tr>
    <!-- DEFINE $LEFT_ARTICLE = true -->
  <!-- ENDIF -->
<!-- END newstopic -->
</tr></table>

That gives me this:

Story 1
Story 2
Story 3 - (Blank Space)
(Blank Space) - Story 4
Story 5 - (Blank Space)


medigangsta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b
Back to top
View user's profile Visit poster's website
medigangsta
Nice poster


Joined: Jul 16, 2004
Posts: 69

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Apr 23, 2005 8:28 pm
Reply with quote

The Journey Continues Very Happy

In my quest to gain the following theme behaviour

Story 1
Story 2
Story 3 - Story 4
Story 5 - Story 6

I have somehow managed to come up with the complete opposite, and currently have

Story 1 - Story 2
Story 3
Story 4
Story 5
Story 6

I'll post the code up just in case someone wants this type of behviour, or if someone can help me find out where I've gone wrong. I keep thinking I'm so close to achieving my goal, then it goes wrong again Sad

Code:
<!-- DEFINE $LEFT_ARTICLE = false -->
<table align="center"><tr>
<!-- BEGIN newstopic -->
<td width="50%">
<a href="{newstopic.U_NEWTOPIC}"><img src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" /></a>
<span class="legend">{newstopic.S_TITLE}</span>
  <font size="2" color="#000000">{newstopic.S_STORY}
  <!-- IF newstopic.S_NOTES -->
  <br /><br /><b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i>
  <!-- ENDIF -->
  </font>
  <font size="1" color="#035D8A">{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_TIME}</font>
  <div align="right"><span class="storyfoot">{newstopic.S_MORELINK}</span></div>
</td>
  <!-- IF $LEFT_ARTICLE -->
    </tr></table><table><tr>
  <!-- ELSE -->
  <!-- DEFINE $LEFT_ARTICLE = true -->
  <!-- ENDIF -->
<!-- END newstopic -->
</tr></table>


medigangsta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b
Back to top
View user's profile Visit poster's website
medigangsta
Nice poster


Joined: Jul 16, 2004
Posts: 69

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Apr 23, 2005 11:28 pm
Reply with quote

Unless a member of the Dev Team can point me in the right direction, I now believe it is currently improssible to create this behaviour with Dragonfly, almost certainly not by using the code DJMaze pasted earlier as a base.

In one of my earlier posts I thought I had created the beginnings of it by having:

Story 1
Story 2 - Story 3
Story 4 - Story 5

However, it turns out this is only because there were an odd number of stories on the page, in this instance, adding a 6th story creates the following look:


Story 1
Story 2 - Story 3
Story 4 - Story 5
Story 6

So, sadly, I'm throwing in the towel. Hopefully a member of the Dev team with more of an idea behind the templating system could give some pointers as to whether or not this is possible.

I'm very happy to do the leg work on this if someone has any ideas, unfortunately I've used up all mine. Sad


medigangsta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b
Back to top
View user's profile Visit poster's website
Head-e
Silver Supporter


Joined: Apr 20, 2004
Posts: 937

PostPost subject: Re: How to have 2 news side by side?
Posted: Sun Apr 24, 2005 1:39 am
Reply with quote

try making a seperate file called articles2.html for a side by side format and then find a way to specify wich template is called

just an idea


Head-e please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile
medigangsta
Nice poster


Joined: Jul 16, 2004
Posts: 69

PostPost subject: Re: How to have 2 news side by side?
Posted: Sun Apr 24, 2005 2:09 pm
Reply with quote

Its a good idea. I tried something similar by using Phoenix's latest news block, the trick is though how to stop duplicate stories occuring.

For example, you have the 5 latest news stories at the top of your site. The next story has to be story 6, but by stating stories should start there, begins at Story 1 again. To my knowledge, there's no way of saying, for example:

<!-- Start Stories (-6) Here -->

Or something like that.


medigangsta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b
Back to top
View user's profile Visit poster's website
Gerald
Supporter


Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat May 07, 2005 4:01 pm
Reply with quote

So, I just wanted to ask where has all this ended up. I need to work up a theme that looks like a news paper with a 2 colum style thing going on. Any word . . . ?
_________________
Gerald Scott
Asheville, NC US

Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
Back to top
View user's profile Visit poster's website
Gerald
Supporter


Joined: Oct 19, 2004
Posts: 508
Location: Asheville, NC

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat May 07, 2005 4:53 pm
Reply with quote

Just a note here. I used DJMaez's code snip, I added the table class direction and bang two colums in the main page view and one in the read more. I reposting the code just because I can. . . Rolling Eyes

Code:
<!-- DEFINE $LEFT_ARTICLE = true -->
<table><tr>
<!-- BEGIN newstopic -->
<td class="newsarticle">
<a href="{newstopic.U_NEWTOPIC}"><img src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" /></a>
<span class="legend">{newstopic.S_TITLE}</span>
  <font size="2" color="#000000">{newstopic.S_STORY}
  <!-- IF newstopic.S_NOTES -->
  <br /><br /><b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i>
  <!-- ENDIF -->
  </font><br />
  <font size="1" color="#035D8A">{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_TIME}</font>
  <div align="right"><span class="storyfoot">{newstopic.S_MORELINK}</span></div>
</td>
  <!-- IF $LEFT_ARTICLE -->
    <!-- DEFINE $LEFT_ARTICLE = false -->
  <!-- ELSE -->
    </tr><tr>
    <!-- DEFINE $LEFT_ARTICLE = true -->
  <!-- ENDIF -->
<!-- END newstopic -->
</tr></table>

ps: replace the part of the code in the file with this snip-it. Thank you DJMaze...

pss: IE SUCKS this only works with FoxFire (netscape). Is there any way to force this to work with IE?

_________________
Gerald Scott
Asheville, NC US

Gerald's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )
Back to top
View user's profile Visit poster's website
stu1
Newbie


Joined: Aug 27, 2005
Posts: 7
Location: Philippines

PostPost subject: Re: How to have 2 news side by side?
Posted: Tue Aug 30, 2005 12:09 pm
Reply with quote

So, As I have understood this thread, the "Quad Module" doesn't work in Dragonfly. I'm not a coder. Has anyone been able to get more than 1 (2-5) central blocks horizontally in Dragonfly, yet?

stu


stu1's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Don\'t know on Virtual Host
Back to top
View user's profile Visit poster's website
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5668
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: How to have 2 news side by side?
Posted: Tue Aug 30, 2005 1:35 pm
Reply with quote

I didn't test the following but it should work

Use the following inside the loop
PHP:
<!-- DEFINE $LEFT_ARTICLE = $LEFT_ARTICLE+1 -->

Then a little further down inside the loop use
PHP:
<!-- IF $LEFT_ARTICLE % 2 = 0 -->

What does this do?
A % is a 'mod' calculation it's like (x = x-((x / 2) * 2))

Say x = 6 then:
x / 2 = 3
x * 2 = 6
x - 6 = 0

If x = 7 then:
x / 2 = 3.5 = 3
x * 2 = 6
x - 6 = 1

That way you can use something like:
Code:
<table>
<!-- IF $LEFT_ARTICLE % 3 = 0 -->
<tr><td>message</td>
<!-- ELSEIF $LEFT_ARTICLE % 3 = 1 -->
<td><table><tr><td>message</td>
<!-- ELSEIF $LEFT_ARTICLE % 3 = 2 -->
<td>message</td></tr></table></td>
<!-- ENDIF -->

This will output:
Code:
┌─────────────┬─────────────┐
│             │             │
│             │  Article 2  │
│             │             │
│  Article 1  ├─────────────┤
│             │             │
│             │  Article 3  │
│             │             │
└─────────────┴─────────────┘
Shure it's not the best method if there are NOT 3, 6, 9, etc. articles but it gives you an idea how powerfull themeing actualy is.


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
beforelast
Dragonfly addicted


Joined: Sep 04, 2005
Posts: 315

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Dec 17, 2005 11:22 pm
Reply with quote

i was wondering if i could get support on this .. "dual news".. when i have a smaller article beside a larger article the smaller arctile appears in the center of the news .. it look wierd .. how would i make it so all news appears at the top?
_________________


beforelast's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Windows XP/Apache 2.0.52/MySQL 4.0.21/PHP 5.0.2/DragonflyCMS 9.0.6.0/ Mozilla Firefox1.7x IE6 Opera 8.0
Back to top
View user's profile Visit poster's website
xfsunoles
XHTML Specialist


Joined: Apr 30, 2004
Posts: 2502
Location: Melbourne, Florida

PostPost subject: Re: How to have 2 news side by side?
Posted: Mon Dec 19, 2005 8:28 pm
Reply with quote

Even Number is 2,4,6,8,10 is Best Way to do Dual News. If you put odd number then you break math operation of the loop. we should drop odd number to make dual news better so loop can do put news side by side.

xfsunoles's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS
Back to top
View user's profile Visit poster's website AIM Address MSN Messenger Yahoo Messenger
medigangsta
Nice poster


Joined: Jul 16, 2004
Posts: 69

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Jan 07, 2006 8:04 pm
Reply with quote

I'm beginning to work on this again and am looking on at the development of the Pro News module with big interest.

However, although I see the logic in what DJMaze has said above, I just can't get it to work, I've tried a few different variations and nothing seems to work.

With the themeing system on DF being so vastly different to the other major CMSs available, I feel it'd be helpful if there was detailed documentation such as what DJMaze has provided above so that virtually anyone with any kind of coding knowledge could start designing different themes so that DF can move away from the standard three column design that, in my opinion, is holding it back slightly.

If someone could apply what DJMaze posted above to a working example that I cold copy and paste onto my test site and work from to try and create some different and interesting theme behaviours I'd be most grateful. Very Happy


medigangsta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b
Back to top
View user's profile Visit poster's website
run0
Supporter


Joined: Jun 28, 2004
Posts: 1559

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Jan 07, 2006 8:39 pm
Reply with quote

t3los figured out how to to have dual columns if that is what you are looking for.
_________________


run0's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x
Back to top
View user's profile Visit poster's website
medigangsta
Nice poster


Joined: Jul 16, 2004
Posts: 69

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Jan 07, 2006 10:01 pm
Reply with quote

No that's not what I'm looking for, I can manage to do that just fine.

However, as I explained earlier in the thread I was looking into making a theme that did the following:

Story 1
Story 2 - Story 3
Story 4 - Story 5

And so on.

However, I would also be interested in looking into something that defines clear differences between the top story and the bottom few. Similar to what can be seen on this page would be near to what I'd be looking for in that respect. Skysports

As you can see on that page, the first story has a large thumbnail next to it and is more prominant on the page with more information next to it, but the next few stories are simple one-liners with less prominance to them.

Perhaps I'm being a pain by trying to do this so publicly but the reason for me doing this is often when I find out how to do things through searching the forums and if my attempts to see how much the DF themeing system can really do help even just one other person in the community, then I'm happy. Smile


medigangsta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b
Back to top
View user's profile Visit poster's website
jerryrp
Newbie


Joined: Feb 17, 2006
Posts: 3
Location: New Port Richey, Florida

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Mar 11, 2006 4:14 am
Reply with quote

I tried the code that Gerald had most recently posted and it worked in both IE7 and firefox. Trying to edit the code to blend in with my theme but not having any luck.

Any suggestions at which points I should put the additional codes.
Here is my original code. Any suggestions would be gratefull.

Code:
<!-- BEGIN newstopic -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
			<div class="cell_wrapper">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td class="cell_header">
					{newstopic.S_TITLE}
					</td>
				</tr>
				<tr>
					<td class="cell_content">
					<a href="{newstopic.U_NEWTOPIC}">
					<img style="padding-left:10px; padding-bottom:10px;" 
						src="{newstopic.IMG_TOPIC}" 
						alt="{newstopic.S_TOPIC}" 
						border="0" 
						align="right" />
					</a>
					{newstopic.S_STORY}
					<!-- IF newstopic.S_NOTES -->
					<br /><br />
					<b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i>
					<!-- ENDIF -->
					</td>
				</tr>
				<tr>
					<td class="cell_info">
					{newstopic.S_MORELINK} {newstopic.S_READS}
					</td>
				</tr>
				<tr>
					<td class="cell_footer">
					{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_ON} 
					{newstopic.S_TIME}
					</td>
				</tr>
			</table>
			</div>
		</td>
	</tr>
</table>
<!-- END newstopic -->

Thanks
Jerry


jerryrp's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
GPGNuke 9.0.6.1
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please All times are GMT
Go to page Previous  1, 2, 3, 4  Next
Page 3 of 4


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 1.4273 seconds with 19 DB Queries in 0.1152 seconds
Memory Usage: 3.05 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy