PDA


View Full Version : News Module...


Pages : [1] 2

fLoW
07-25-2005, 08:36 PM
How can I make my news modules to be like this...

News 1 | News 2
News 3 | News 4

Im just trying to have more news post visible to my clients, anyone can help me with this one... Thanks in advanced!!!! :)

JWEB
08-08-2005, 03:49 AM
y! Help with thi Question

fLoW
08-11-2005, 12:00 AM
Ok.... I want to make at least 6 small news box on my front page wich should look like this in two columns.....

News 1 | News 2
News 3 | News 4
News 5 | News 6

I use to have it on my prior CMPS 1.X but bcause of the update i cant have it like that anymore, so is there a way to have the news like that?

sean
08-11-2005, 01:25 AM
Hi there, JWEB had already requested/asked this question from me and I decided to write a little code myself to show it to him for an example, as soon as I get that done I'll share it with you here.

zenithrs@bigpon
08-11-2005, 06:57 AM
You don't need code, just template edits.

http://www.vbadvanced.com/forum/showpost.php?p=41251&postcount=27

That's for version 1 of course, but you get the drift I'm sure.

JWEB
08-12-2005, 08:28 AM
sean plz create such .module, I could not understand the instructions of zenithrs@bigpon

fLoW
08-13-2005, 01:11 AM
Hi there, JWEB had already requested/asked this question from me and I decided to write a little code myself to show it to him for an example, as soon as I get that done I'll share it with you here.
Thanks sean!

JWEB
08-16-2005, 05:19 AM
sean people's wait

sean
08-16-2005, 05:14 PM
don't worry I'm still working on it, I didn't had that much time since I had to work more hours. I'll try to finish it by at least tomarrow hopefully.

JWEB
08-17-2005, 06:06 AM
okok

fLoW
08-17-2005, 06:37 PM
don't worry I'm still working on it, I didn't had that much time since I had to work more hours. I'll try to finish it by at least tomarrow hopefully.
Any luck with it?

sean
08-18-2005, 02:22 PM
sorry so far I have had no luck with it, but I'm still working on what i have so far, I also tried looking at zenithrs@bigpon's solution as well, but it's a bit different to do since the template code that he has is for v1 of vba. If I don't get it right I probably hire someone to do it, cause I will eventually need this as well.

fLoW
08-20-2005, 11:29 AM
sorry so far I have had no luck with it, but I'm still working on what i have so far, I also tried looking at zenithrs@bigpon's solution as well, but it's a bit different to do since the template code that he has is for v1 of vba. If I don't get it right I probably hire someone to do it, cause I will eventually need this as well.
Kool.. thanks sean for ur efforts... Im gonna keep checking this and Ill be still waiting for it....

fLoW
08-23-2005, 07:55 PM
I hope any of ya guys have any luck with this stuff! Any news abt this module?

fLoW
09-01-2005, 09:22 PM
any luck Sean? Im crazy abt this module 2 b done!

Nordinho
09-01-2005, 09:30 PM
I'm pretty close, just can't manage the last bit see this thread http://www.vbadvanced.com/forum/showpost.php?p=59829&postcount=46

sean
09-02-2005, 03:11 AM
Hi again,

I took a look at your code Nordinho and made some minor changes to it, you got pretty much all the code, so far it seems to work with vba cmps v2, so I'll show you the code that you had with my little fixes, hope that this will help you Nordinho, fLoW, and JWEB for now, later on I'll see if I can fix the issues with the title's <if> functions and the fix with the "seperate news posts".

First things first, if you want this module to work correctly, you have to disable module shell template for the "News" module.

Second, you need to make sure that this is set to Yes in the page that you want to show the news in 2 columns "Seperate News Pages".

Last thing you need to do is to open your adv_portal_newsbits and paste the following code,

<if condition="$newscount == 1">
<table cellpadding="0" width="100%" height="100%">
</if>

<if condition="($newscount % 2)">
<tr>
</if>
<td valign="top" width="50%">

<table height="100%" align="center" border="0" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">

<tr>
<td class="tcat"><if condition="$mod_options['portal_news_showicon']">$vba_style[portal_blockbullet]</if> <a href="$vboptions[bburl]/showthread.php?t=$news[threadid]">$news[title]</a></td>
</tr>


<tr>
<td class="<if condition="$mod_options['portal_news_legacy']">thead<else />alt2</if>">
<if condition="$mod_options['portal_news_showrating'] AND $news['votenum']">
<span style="float:$stylevar[right]"><img alt="" src="$stylevar[imgdir_rating]/rating_$news[rating].gif" title="<phrase 1="$news[votenum]" 2="$news[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span>
</if>
$news[dateposted] - <phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$news[postuserid]" 2="$news[postusername]">$vbphrase[by_x]</phrase>
</td>
</tr>
<tr height="100%">
<td align="$stylevar[left]" class="alt1" valign="top">
<if condition="$news['avatarpath']">
<img align="$stylevar[left]" style="padding:6px" alt="" border="0" src="$news[avatarpath]" title="$news[postusername]'s $vbphrase[avatar]" />
</if>
$news[message]

<if condition="$show['signature']">
<div>__________________<br />
$news[signature]</div>
</if>

</td>
</tr>

<if condition="$news['attachment']">
<tr class="alt1">
<td>
<fieldset class="fieldset">
<legend>Attached Files</legend>
<div style="padding:$stylevar[formspacer]px">
$news[attachment]
</div>
</fieldset>
</td>
</tr>
</if>

<!--your here -->

<tr class="alt2" valign="middle">
<td valign="middle">
<span style="float:right">
<if condition="$show['editbutton']">
<a href="$vboptions[bburl]/editpost.php?$session[sessionurl]do=editpost&amp;p=$news[postid]"><img alt="$vbphrase[edit_this_post]" border="0" src="$stylevar[imgdir_button]/edit.gif" /></a>
</if>

<if condition="$show['replybutton']">
<a href="$vboptions[bburl]/newreply.php?$session[sessionurl]do=newreply&amp;t=$news[threadid]"><img alt="$vbphrase[reply_to_this_post]" border="0" src="$stylevar[imgdir_button]/reply_small.gif" /></a>
</if>

<if condition="$mod_options['portal_news_showsendfriend']">
<a href="$vboptions[bburl]/sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=$news[threadid]"><img alt="" border="0" src="$stylevar[imgdir_button]/sendtofriend.gif" title="$vbphrase[send_to_friend]" /></a>
</if>

<if condition="$mod_options['portal_news_showprintable']">
<a href="$vboptions[bburl]/printthread.php?$session[sessionurl]t=$news[threadid]"><img alt="" border="0" src="$stylevar[imgdir_button]/printer.gif" title="$vbphrase[show_printable_version]" /></a>
</if>
</span>

<span class="smallfont">
<if condition="$mod_options['portal_news_allowreplies']">$news[replycount] <if condition="$news['replycount'] == 1">$vbphrase[reply]<else />$vbphrase[replies]</if> | </if> $news[views] $vbphrase[views]</span>
</td>
</tr>

</table>
</td>
<if condition="!($newscount % 2)">
</tr>
<if condition="$newscount == $mod_options['portal_news_maxposts']">
</table>
<div><img src="$vboptions[bburl]/$vboptions[cleargifurl]" height="$vba_style[portal_vspace]" alt="" /></div>
</if>
<else />
<if condition="$newscount == $mod_options['portal_news_maxposts']">
<td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet] Advertisements</b></span><br /><br />
<center>
<script type="text/javascript">Ads</script>
</center>
</td>
</tr>
</table>
</if>
</if>


One last thing that I would like to mention, if you want all the news posts in the columns to have the same height, the best go at it is to simply decrease your news maxium character number, "Maximum Characters to Display".

Hope that this will fix your problem for now Nordinho.

Nordinho
09-02-2005, 02:50 PM
thanks a big lot Sean!! it fixed it...I was pretty close ;)...btw...if you want the attachments to show up on the left side (see attachment)...use the code below...

<if condition="$newscount == 1">
<table cellpadding="0" width="100%" height="100%">
</if>

<if condition="($newscount % 2)">
<tr>
</if>
<td valign="top" width="50%">

<table height="100%" align="center" border="0" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">

<tr>
<td class="tcat"><if condition="$mod_options['portal_news_showicon']">$vba_style[portal_blockbullet]</if> <a href="$vboptions[bburl]/showthread.php?t=$news[threadid]">$news[title]</a></td>
</tr>


<tr>
<td class="<if condition="$mod_options['portal_news_legacy']">thead<else />alt2</if>">
<if condition="$mod_options['portal_news_showrating'] AND $news['votenum']">
<span style="float:$stylevar[right]"><img alt="" src="$stylevar[imgdir_rating]/rating_$news[rating].gif" title="<phrase 1="$news[votenum]" 2="$news[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span>
</if>
$news[dateposted] - <phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$news[postuserid]" 2="$news[postusername]">$vbphrase[by_x]</phrase>
</td>
</tr>
<tr height="100%">
<td align="$stylevar[left]" class="alt1" valign="top">
<if condition="$news['avatarpath']">
<img align="$stylevar[left]" style="padding:6px" alt="" border="0" src="$news[avatarpath]" title="$news[postusername]'s $vbphrase[avatar]" />
</if>

<if condition="$news['attachment']">
<span style="float: left; margin: $stylevar[cellpadding]px $stylevar[cellpadding]px $stylevar[cellpadding]px 0px">
$news[attachment]
</span>
</if>

$news[message]

<if condition="$show['signature']">
<div>__________________<br />
$news[signature]</div>
</if>

</td>
</tr>

</td>
</tr>
<!--your here -->

<tr class="alt2" valign="middle">
<td valign="middle">
<span style="float:right">
<if condition="$show['editbutton']">
<a href="$vboptions[bburl]/editpost.php?$session[sessionurl]do=editpost&amp;p=$news[postid]"><img alt="$vbphrase[edit_this_post]" border="0" src="$stylevar[imgdir_button]/edit.gif" /></a>
</if>

<if condition="$show['replybutton']">
<a href="$vboptions[bburl]/newreply.php?$session[sessionurl]do=newreply&amp;t=$news[threadid]"><img alt="$vbphrase[reply_to_this_post]" border="0" src="$stylevar[imgdir_button]/reply_small.gif" /></a>
</if>

<if condition="$mod_options['portal_news_showsendfriend']">
<a href="$vboptions[bburl]/sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=$news[threadid]"><img alt="" border="0" src="$stylevar[imgdir_button]/sendtofriend.gif" title="$vbphrase[send_to_friend]" /></a>
</if>

<if condition="$mod_options['portal_news_showprintable']">
<a href="$vboptions[bburl]/printthread.php?$session[sessionurl]t=$news[threadid]"><img alt="" border="0" src="$stylevar[imgdir_button]/printer.gif" title="$vbphrase[show_printable_version]" /></a>
</if>
</span>

<span class="smallfont">
<if condition="$mod_options['portal_news_allowreplies']">$news[replycount] <if condition="$news['replycount'] == 1">$vbphrase[reply]<else />$vbphrase[replies]</if> | </if> $news[views] $vbphrase[views]</span>
</td>
</tr>

</table>
</td>
<if condition="!($newscount % 2)">
</tr>
<if condition="$newscount == $mod_options['portal_news_maxposts']">
</table>
<div><img src="$vboptions[bburl]/$vboptions[cleargifurl]" height="$vba_style[portal_vspace]" alt="" /></div>
</if>
<else />
<if condition="$newscount == $mod_options['portal_news_maxposts']">
<td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet] Advertisements</b></span><br /><br />
<center>
<script type="text/javascript">
Ads
</script>
</center>
</td>
</tr>
</table>
</if>
</if>

sean
09-03-2005, 04:20 AM
np bud, glad I could help a little.

fLoW
09-03-2005, 08:29 AM
This is great guys, thanks for ur help really, im goin to try it 2day, it looks sweet!!!!

fLoW
09-03-2005, 09:06 AM
Is not working either one of this codes, the blocks doesnt aling well, bsides having just 2 colums, 3 appears, and the first column its with one news, the second have two, and the 3rd two more.... like this

--news 1 | new2
--blank--| news 3 | news 4
--blank--| news 5 | news 6

Nordinho
09-03-2005, 09:35 AM
did you make sure the 'seperate news' function is disabled??

fLoW
09-03-2005, 09:38 AM
yes i did...

Nordinho
09-03-2005, 10:05 AM
hmm weird..

It works for me, and I'm using the template I posted above, use modele_shell temlate = no , disabled 'seperate news posts' in the news module...and set 'seperate news posts' to yes in the 'default/homepage' options...

fLoW
09-03-2005, 10:37 AM
hmm weird..

It works for me, and I'm using the template I posted above, use modele_shell temlate = no , disabled 'seperate news posts' in the news module...and set 'seperate news posts' to yes in the 'default/homepage' options...

I have the module_shell template = no
separate news post = no

now whats this next default/homepage separate news posts?

Nordinho
09-03-2005, 11:10 AM
if you go to 'edit pages' and edit your default homepage (or another page if the 2-columns newsmodule is displayed on another page), there's an option as well to seperate news posts...

fLoW
09-03-2005, 01:39 PM
Okm i did that but still the same... heres a sample of how it looks again!

Do u think i have to bake any changes to any of the templates this modules use (adv_portal_newsbit, bbcode_quote, bbcode_php, postbit_attachment, postbit_attachmentimage, postbit_attachmentthumbnail)?

also, Im using vb3.08 just in case... if that matters!

fLoW
09-03-2005, 01:58 PM
ok I got it.. it was the end of the code that had the Ad..... i took that off and it work, now its just how big i want my boxes.... but my info doesnt show the whole thing, the news are cutting off.... what should i do in this case!!!???

sean
09-03-2005, 02:16 PM
sorry what do you mean the news are cutting off? how are they cutting off? it might have to do with the maximum characters that you have set.

fLoW
09-03-2005, 02:24 PM
sorry what do you mean the news are cutting off? how are they cutting off? it might have to do with the maximum characters that you have set.
ok i find out already what it was... but if u can realize in this pic, the box are uneven... how can i have them even?

fLoW
09-03-2005, 03:54 PM
now the question is.... why the 1st row of news is more bigger than the second one? How can i have the same space for both of them?

Nordinho
09-04-2005, 12:20 AM
if you used my template then replacing "$stylevar[htmldoctype]" with "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">" in your adv_portal template might do the trick...

fLoW
09-04-2005, 06:52 AM
if you used my template then replacing "$stylevar[htmldoctype]" with "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">" in your adv_portal template might do the trick...

Kool.... thanks... that did it!!!! But one more thing..... the right column doesnt show correctly, its like just part of it shows.... look @ the pic and let me know what can i do abt it!!!

Nordinho
09-04-2005, 10:13 AM
looks like the site is just too big for the screen...

fLoW
09-04-2005, 11:33 AM
aahh, ok kool.... thanks 4 the help!!!!

JWEB
09-04-2005, 03:19 PM
if you used my template then replacing "$stylevar[htmldoctype]" with "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">" in your adv_portal template might do the trick...
It does not work in Opera

jaffa
09-13-2005, 02:18 PM
Hi guys, this looks like a really sweet mod but i'm having a few proplems with it.

Firstly, and probably the cause of the problem, i cant find the textbox to enter the forums i want to use as news. I see the list for forums on my board and can select one of them by clicking on it, but no place to select more than one,

Secondly when i try to upload an attachment i get this error
Warning: filesize(): open_basedir restriction in effect. File(/tmp/phplkQdFd) is not within the allowed path(s): (/home/edinburghmuk/public_html) in /includes/functions_file.php on line 289

Thirdly, i only seem to have an option for 'Separate News Posts' and not 'Separate News Pages'

and finally, just out of interest; thow will the module work if the news module is turned off??

im using vb 3.0.9 with cmps 2.0

Thanx in advance

sean
09-14-2005, 01:19 AM
sorry jaffa but most of the problems that you stated is not from the module (if you have installed it correctly according to the instructions)

For your first question, no you can't select more than one forum. This module will only display the regular news option in two columns, so basically it is the same as the original vba news module, but it just has different template/structure.

Second question, not really sure what the problems is from exactly, it is most likely a problem from your forum (vb) itself, or may a code has changed in 3.0.9? not sure.

Thrid, yes you are right, you should use "seperate news posts"

hope that helps.

jaffa
09-15-2005, 10:09 AM
ok, thanks i reverted back to the orignal script to get things working normaly

Nordinho
09-22-2005, 12:04 PM
If you use the threadicon hack (http://www.vbadvanced.com/forum/showthread.php?t=5193) you can select all forums...

fLoW
09-26-2005, 07:50 PM
OK now is another lil question o this part of the code.......

<else />
<if condition="$newscount == $mod_options['portal_news_maxposts']">
<td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet]<a href="http://www.micorillo.com/forum/calendar.php"><img src="http://www.micorillo.com/images/rbanner/rs.gif"></b></span><br /><br />
<center>
<script type="text/javascript">Ads</script>
</center>
</td>
</tr>
</table>
</if>
</if>

How can i choose from a specific folder to take differents banners, like every time someone refresh or visit my page it would choose any banner in that specific folder!! :confused:

fLoW
09-27-2005, 06:23 PM
please help w/this one!!!!

adminegypt
10-01-2005, 02:59 AM
Up

sean
10-11-2005, 02:46 AM
Is this banner that your talking about advertising banners? if so why don't you use a program such as phpadsnew or at least something close to that which is simpler to use?

I personally use phpadsnew for banners/advertisement at my site, and for everything else, such as random headers/images/... I use this script, http://photomatt.net/scripts/randomimage , it works great with everything I have so far.

Pretty much what i do is I include the php page in the phpinclude template, and call the variable assigned to it in the template. Should work here too.

Ski-Whiz
10-12-2005, 03:45 PM
if you used my template then replacing "$stylevar[htmldoctype]" with "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">" in your adv_portal template might do the trick...


That did it for me too! Thanks!

jaffa
10-22-2005, 12:28 PM
Ok this is working fior me now but i have a problem with my thumbnail images, as the appier to be broken

When i select the propertie so see where the file is being help it reads '/attachment.php?attachmentid=6&stc=1&thumb=1&d=]'

when i click on the broken image it then displays correctly so the image isnt broken :confused:

any ideas

Brian
10-22-2005, 12:46 PM
Jaffa - Please do not post the same message about the same problem multiple times.

TheNakedMan
12-27-2005, 11:30 AM
This is not working in 3.5

It throws the news under the left column and such.

gothic1213
01-17-2006, 02:48 AM
Just installed this mod into 3.5.3, works perfectly!
My query is this, is there any way to change the 'link' when you click on the thumbnail to reflect the thread as opposed to the image.
Also, see the attached thumb, and is there any way to get the two rows the same height?
Hope you understood that, I certainly didn't.... perhaps I haven't had enough coffee this morning..... perhaps I'm just getting too old.. :(

gothic1213
01-17-2006, 02:54 AM
Sorry lads, really must learn to read all the posts......:eek:
I now know how to set the two columns to the same height.