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


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

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

Hi Jerry,
I wish I could help, if I could I would be doing a lot of template work myself. Good Luck.

_________________
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
gorkij
Newbie


Joined: Oct 23, 2005
Posts: 4
Location: Göteborg, Sweden

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

Hey all. I've been doing some modifications along the lines suggested in this thread and managed to reproduce the two-column layout when using the default Dragonfly theme.

However, I'd like to do a similar thing with a modified version of the fisubsilver-theme, but I just can't get my head around what I'm doing wrong, since I basically can limit the width of the news item, but I can't get it to appear in two columns...
Any insightful persons out there that might have an idea?

Code:
<!-- BEGIN newsempty -->
<table width="100%" border="0" cellspacing="0" cellpadding="4">
    <tr>
	<td><table width="100%" border="0" cellspacing="0" cellpadding="1">
    </tr>
    <tr>
	<td bgcolor="#006699"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    </tr>
    <tr>
        <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="0">
    </tr>
    <tr>
	<td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="4">
    </tr>
    <tr> 
	<td>
	<center>
	<font class="title">{newsempty.S_SITENAME}</font><br /><br />
        {newsempty.S_NOTOPIC}<br /><br />
        [ <a href="{newsempty.U_NEWSINDEX}">{newsempty.S_GONEWS}</a> | <a href="{newsempty.U_TOPICS}">{newsempty.S_SELECT}</a> ]
	</center>
	</td>
    </tr>
</table>
</td>
</tr>
</table></td>
    </tr>
    </table></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="tbl">
    <tr>
	<td class="tbll"><img src="images/spacer.gif" alt="" width="8" height="4" />
	</td>
	<td class="tblbot"><img src="images/spacer.gif" alt="" width="8" height="4" />
	</td>
	<td class="tblr"><img src="images/spacer.gif" alt="" width="8" height="4" />
	</td>
    </tr>
</table>
</td>
 </tr>
  </table-->
<!-- END newsempty -->

<!-- BEGIN newscat -->
<table class="newsindex">
    <tr>
	<td>
	<center><font class="title">{newscat.S_SITENAME}: {newscat.S_TOPIC_T}</font><br /><br />
	<form action="{newscat.U_SEARCH}" method="post" {I18N}>
	<input type="hidden" name="topic" value="{newscat.I_TOPIC}" />
	{newscat.S_SEARCHON}: <input type="name" name="search" size="30" maxlength="255" />&nbsp;&nbsp;
        <input type="submit" value="{newscat.S_SEARCH}" />
	</form>
	[ <a href="{newscat.U_HOME}">{newscat.S_GOHOME}</a> | <a href="{newscat.U_TOPICS}">{newscat.S_SELECT}</a> ]</center>
	</td>
    </tr>
</table>
<br />
<!-- END newscat -->

<!-- DEFINE $LEFT_ARTICLE = true -->
<table>
    <tr>
<!-- BEGIN newstopic -->
    <td style="width:45%" cellpadding="4">
    <tr>
	<td style="vertical-align: top;">
	    <table border="0" cellspacing="0" cellpadding="1" width="100%">
		<tr>
		    <td bgcolor="#006699">
		    <table width="100%" border="0" cellspacing="0" cellpadding="0">
			<td height="27" background="themes/fisubsilversh/images/cellpic1.gif" bgcolor="#EAEDF4">
			<div align="left"><font class="title">&nbsp;<b>{newstopic.S_TITLE}</b></font></div>
			</td>
		    </table>
		    </td>
		</tr>
	    </table>
	</td>
	<td>
	</td>		
    </tr>
    <tr>
	<td style="vertical-align: top;">
	    <table width="100%" border="0" cellspacing="0" cellpadding="1">
		<tr>
		<td bgcolor="#006699">
		    <table width="100%" border="0" cellspacing="0" cellpadding="4">
            		<td bgcolor="#EAEDF4" valign="top">{newstopic.S_STORY}
			<!-- IF newstopic.S_NOTES -->
			<br /><br /><br /><b>{newstopic.S_NOTE}</b><i>{newstopic.S_NOTES}</i>
			<!-- ENDIF -->
			</td>
                    	<td bgcolor="#EAEDF4" valign="top"><a href="{newstopic.U_NEWTOPIC}"><img src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" hspace="2" vspace="2" /></a>
			</td>
		    </table>
		</td>
		</tr>    
    	    </table>
	</td>
	
	
    </tr>
    <tr>
	<td style="width:30%; vertical-align: top">
	    <table width="100%" border="0" cellspacing="0" cellpadding="1">
	    	<tr>
		    <td bgcolor="#006699">
		    <table width="100%" border="0" cellspacing="0" cellpadding="0">
			<td nowrap bgcolor="#EAEDF4" background="themes/fisubsilversh/images/cellpic4.gif">
			<div align="center">
			<!--font class="content">{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_ON} {newstopic.S_TIME} {newstopic.S_READS}</font><br-->
			<font class="content">{newstopic.S_MORELINK}</font></div>
			</td>
		    </table>
		    </td>
		</tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" class="tbl">
		<tr>
		    <td class="tbll"><img src="images/spacer.gif" alt="" width="8" height="4" />
		    </td>
		    <td class="tblbot"><img src="images/spacer.gif" alt="" width="8" height="4" />
		    </td>
		    <td class="tblr"><img src="images/spacer.gif" alt="" width="8" height="4" />
		    </td>
		</tr>
	    </table>
	</td>
	<td>
	</td>
    </tr>
    </td>
<!-- IF $LEFT_ARTICLE -->
<!-- DEFINE $LEFT_ARTICLE = false -->
<!-- ELSE -->
</tr><tr>
<!-- DEFINE $LEFT_ARTICLE = true -->
<!-- ENDIF -->
<!-- END newstopic -->
    </tr>
</table>
Any ideas?


gorkij's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.52/5.0.15/5.0/9.0.6.1
Back to top
View user's profile Visit poster's website
ConViCt
Nice poster


Joined: Jun 18, 2004
Posts: 114
Location: Canada

PostPost subject: Re: How to have 2 news side by side?
Posted: Wed Mar 29, 2006 9:09 pm
Reply with quote

Has anybody figured out how to get this layout to work on their site? Holy Cow! THis is definitely what I need, if only I could figure out how to get it to work!


DJMaze wrote:
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:
PHP:

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.


ConViCt's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD 4.9/MySQL 4.1.11/PHP Version 4.4.8/DragonFly 9.2.1
Back to top
View user's profile Visit poster's website
jzky
Supporter


Joined: Jun 25, 2004
Posts: 220
Location: Norway - Harstad

PostPost subject: Re: How to have 2 news side by side?
Posted: Sat Apr 01, 2006 3:48 pm
Reply with quote

How to add truncate to this? I want all the news "blocks" to be the same size.
_________________
www.jzky.net a Dragonfly site. cms.jzky.net < test site. - Pardon my bad englsih WinkMy home town

jzky's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / Apache / PHP Version 5.2.0 /MySQL Version 4.1.21-standard / CMS Version 9.1.1
Back to top
View user's profile Visit poster's website
t31os
Supporter


Joined: Sep 22, 2004
Posts: 2025
Location: Somewhere in the intertubes... lolz

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

Truncating will only work for text, it can't account for new lines, as in linebreaks, i found this out when i did it, so you will find they don't always quite match up.

Here's the code i used from which one of the DF team members made for me a while back, though the variable name can be pretty much anything you like other then something that exists already.

Find
Code:
row['hometext'] = decode_bb_all($row['hometext'], 1, true);
Change with
Code:
$nochar = '300';
$newsnip = $row['hometext'] = decode_bb_all($row['hometext'], 1, true);
$newsnip = (strlen($newsnip)>$nochar)?substr($newsnip,0,$nochar).'......':$newsnip;

Where 300 is the max amount of characters to show.

Backup first, change code, clear cache, test, if errors, put backup back and post error in a new thread since we're vearing off-topic here.

You'll find you might want to always display the Read More link when you use this, which means further adjustments, otherwise unless you have something in the extra section for the article the read more link will not be there and you'll be missing half an article with no easy way for users to view the missing text.


t31os's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
XP / 2.0 / 5.1 / 5.2 / none
Back to top
View user's profile Visit poster's website
Jo0Lz
Nice poster


Joined: Dec 04, 2004
Posts: 127
Location: Netherlands

PostPost subject: Re: How to have 2 news side by side?
Posted: Fri Apr 20, 2007 9:09 am
Reply with quote

Is there any news on this? I would love to have a layout like the front page of this support site for instance.
Have 2 colums, with four news items.

I can't even seem to change that, as the news is always 5, never four or one for instance...

_________________
I'm not lost, I'm locationally challenged.
Don't you agree? God created some pretty good textures!
Proud admin of FokGuildwars.

Jo0Lz's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger
Jo0Lz
Nice poster


Joined: Dec 04, 2004
Posts: 127
Location: Netherlands

PostPost subject: Re: How to have 2 news side by side?
Posted: Tue Apr 24, 2007 10:47 am
Reply with quote

Since i can't figure out how to change / accomplish this for the TCD_natural theme, I posted a question in the forums over there.
In the meantime I sure will watch this topic, as I'm curious on how to get the news to show up side by side, with a maximum of 4 news items for all members...

_________________
I'm not lost, I'm locationally challenged.
Don't you agree? God created some pretty good textures!
Proud admin of FokGuildwars.

Jo0Lz's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger
Jo0Lz
Nice poster


Joined: Dec 04, 2004
Posts: 127
Location: Netherlands

PostPost subject: Re: How to have 2 news side by side?
Posted: Tue Apr 24, 2007 5:31 pm
Reply with quote

ok, I managed to get a x number of news items on the frontpage. So that's no longer an issue.

What I do wonder however, is why this post has been sticky for as long as it has. Devon, over at TCD, didn't find this information usefull enough to implement this code into his OWN theme, wich kind of makes me wonder, who would ever benefit from this post.

The NSN Centreblocks suggested in this thread, shows four blocks in the right way, but the content is limited to blocks. Therefor I cannot put any news items in it, so that wouldn't fix it at all.

Thanks in advance for shining light on this, as both this site aswell as the Pitcher support site, have four items on the main page. Even though I'm beginning to wonder if that is the news module, showing it...

_________________
I'm not lost, I'm locationally challenged.
Don't you agree? God created some pretty good textures!
Proud admin of FokGuildwars.

Jo0Lz's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 953

PostPost subject: Re: How to have 2 news side by side?
Posted: Tue Apr 24, 2007 8:32 pm
Reply with quote

Well, you may be better off with Pro_News, which can co-exist alongside News, but more importantly is fully templated. While there are no templates (yet) for 2-columns, writing new templates would be a much less steep learning curve than re-coding a whole theme.

CSS can handle wrapping images in a Z-shape pattern down the screen, so a container per Pro_News article... ? And most of the existing templating is already CSS (vs. tables). How good is your CSS? Or your google'ing expertise? Wink Here's a pointer for tiling images.

_________________
Pro_News: The complete module for Dragonfly - now available as version 3.3

layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1
Back to top
View user's profile Visit poster's website
Jo0Lz
Nice poster


Joined: Dec 04, 2004
Posts: 127
Location: Netherlands

PostPost subject: Re: How to have 2 news side by side?
Posted: Thu Sep 13, 2007 9:48 am
Reply with quote

Any news on this yet? Still would love to implement this feature through a block or something. Switching to pronews didn't quite cut it... And the default news system is able to...

Anyone that can offer the final solution?

_________________
I'm not lost, I'm locationally challenged.
Don't you agree? God created some pretty good textures!
Proud admin of FokGuildwars.

Jo0Lz's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger
Jeruvy
Security Team


Joined: Apr 23, 2004
Posts: 1433
Location: Canada

PostPost subject: Re: How to have 2 news side by side?
Posted: Fri Sep 14, 2007 1:58 pm
Reply with quote

Good question. It would seem that around the end of April layingback simly fell off the earth.

You should check his site for any info if you can't find any here.

_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}
Back to top
View user's profile ICQ Number Yahoo Messenger
layingback
Forum Admin


Joined: Apr 19, 2004
Posts: 953

PostPost subject: Re: How to have 2 news side by side?
Posted: Fri Sep 14, 2007 4:00 pm
Reply with quote

layingback didn't fall of the planet - though I was very, very busy with other things (think paying bills, etc., and you get the picture Wink )

I hope I'll get the time to make the next release of Pro_News this year, but can't promise.

My last post wasn't about what I could/would do though, but about encouraging someone else to do it. It's CSS after all not PHP code. PHP isn't hard to learn, although you do need good understanding of Dragonfly and DBMS, but if the serious webmaster of a DF site doesn't want to at least experiment if not master HTML/CSS then they are really missing out, IMHO.

BTW, I had imagined that if I 'broke the camel's back' on getting old Pro_News working, that some number of others would be tweaking and improving it by now... But not so much as a shared template, even though I see many good Pro_News templates out there. Makes one wonder at times if there's any real point releasing ....

_________________
Pro_News: The complete module for Dragonfly - now available as version 3.3

layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1
Back to top
View user's profile Visit poster's website
Jeruvy
Security Team


Joined: Apr 23, 2004
Posts: 1433
Location: Canada

PostPost subject: Re: How to have 2 news side by side?
Posted: Fri Sep 14, 2007 4:11 pm
Reply with quote

Good to hear you didn't fall.

Look forward to hearing about your updates. Keep in mind doing a full blown release might be premature, but certainly interim patchs for now would be all that are needed. Heck I've seen a few in the forums already.

P.S. Bills, ya boy I know them Smile

_________________
J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Jeruvy's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}
Back to top
View user's profile ICQ Number Yahoo Messenger
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
Page 4 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.3149 seconds with 16 DB Queries in 0.2072 seconds
Memory Usage: 3.04 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy