PDA

View Full Version : Need News!!! Image Alignment Module/hack


soletrader
08-18-2006, 12:29 AM
I am in a DESPERATE need to align my news image on my homepage. I have seen many hacks posted for versions 3.5 but none seem to work with 3.6.

I will even pay for this hack/coding. PLEASE let me know asap. THANK YOU

project-Buckfas
08-19-2006, 02:34 PM
Are you using vBadvanced??

If so they can look like THIS (http://www.niinterests.com)

I try to keep my images to around 100 x 100, however image size is totally up to you....

DementedMindz
08-19-2006, 04:25 PM
project-Buckfas how are you posting different images with each post or you just using bbcode?

project-Buckfas
08-20-2006, 01:22 PM
DementedMindz

They are attached images.

You attach an image to a post as you normally would.

Any attached image will show in vbadvanced.

As said above I try to keep my images to 100x100 pixels. It keeps things inline and neat looking!

DementedMindz
08-21-2006, 04:59 PM
thanks for the response :). yeah I was hoping it was something kinda like phpnuke uses where you could chose the image per news post.

project-Buckfas
08-22-2006, 07:11 AM
Edit the template: adv_portal_newsbits

REPLACE all the code in that template with this code. Don't forget to make a backup of the original beforehand.


<if condition="!$mod_options['portal_news_legacy']">
<tr>
<td class="thead"><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>
</if>
<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>
<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>

<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>


Now when you attach an image to a post in a thread that shows in vbadvanced, the image will show in the top left corner of the post. :D

DementedMindz
08-31-2006, 04:46 PM
ok another question for you how did you remove the size from the image? cause mine shows the thumbnail fine but it displays the width and height under it also how did you get the feildset around your image on the post?

ok i removed the deminisions i would just like the feild set that looks good if you dont mind

project-Buckfas
09-02-2006, 02:58 PM
For those that are having problems with guests seeing images, you will need to set the usergroups permissions as follows...


Admincp --> Usergroup Manager --> unregistered/not logged in (or desired usergroup)

Look for "forum viewing permissions"

Set "Can Download Attachments" to yes

DementedMindz
09-10-2006, 09:27 PM
project-Buckfas I noticed one flaw with this. If you dont give a long enough description where it would say read more it will post the attachment on the left and under the post it will say the word attachment with the link.

Insert Username
09-20-2006, 05:35 PM
project-Buckfas, about your hack. We have vbAdvanced powering our CMPS, but I don't have a adv_portal_newsbits. Am I running an older version or something?

DementedMindz
09-20-2006, 05:40 PM
you must be cause its in there. which version are you running?

Insert Username
09-20-2006, 06:24 PM
you must be cause its in there. which version are you running?
ACtually, I found it. Wasn't where I thought it would be.

project-Buckfas
09-21-2006, 09:22 AM
This is not my hack. I seen it posted somewhere else, but there was no author e.t.c...

I cannot offer support for this, but can help to a certain extent...

DementedMindz
09-21-2006, 09:36 AM
only thing im trying to figure out is how to get the attachment to open the thread instead of the attachment.

project-Buckfas
09-21-2006, 11:02 AM
Great idea. I'll have a look later when I get home

DementedMindz
09-21-2006, 11:28 AM
yeah Im going to look it over more today and see what I see. Would make it so much nicer since all it does right now is open the attachment.

DementedMindz
09-25-2006, 05:05 PM
project-Buckfas I was able to get it working great.

postbit_attachmentthumbnail

erase what you have in there and add this.

<if condition="THIS_SCRIPT == 'adv_index'"><a href="$vboptions[bburl]/showthread.php?$session[sessionurl]t=$news[threadid]"><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1" border="0" alt="<phrase 1="$attachment[filename]" 2="$attachment[counter]" 3="$attachment[filesize]">$vbphrase[image_larger_version_x_y_z]</phrase>" /></a></if>
&nbsp;<if condition="$show['br']"><br /><br /></if>

project-Buckfas
09-25-2006, 05:36 PM
It works great on vbadvanced, but when I attach an image in a post, the attachment doesn't show.

DementedMindz
09-25-2006, 05:37 PM
I havent tried it that way Ill look now and see if I can see why

project-Buckfas
09-25-2006, 05:42 PM
Great, thanks DementedMinds

DementedMindz
09-25-2006, 05:47 PM
Try this and let me know if it works for you.

<if condition="THIS_SCRIPT == 'adv_index'"><a href="showthread.php?$session[sessionurl]t=$news[threadid]"><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1" border="0" alt="<phrase 1="$attachment[filename]" 2="$attachment[counter]" 3="$attachment[filesize]">$vbphrase[image_larger_version_x_y_z]</phrase>" /></a>

<else />

<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]"><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1" border="0" alt="<phrase 1="$attachment[filename]" 2="$attachment[counter]" 3="$attachment[filesize]">$vbphrase[image_larger_version_x_y_z]</phrase>" /></a>
&nbsp;<if condition="$show['br']"><br /><br /></if></if>

project-Buckfas
09-25-2006, 06:03 PM
Thats it! Works a treat.

Thanks for that!

DementedMindz
09-25-2006, 06:06 PM
No problem I been messing with it and I kept going till I got It. At first my members had to be going crazy cause I had 2 attachments per news post until I figured out.

I also edited the phrase for it so it didnt show click to show larger image this way it just shows the image name and size.

Mecho
09-28-2006, 03:47 PM
is that any hack for resize [img]files in vbadvanced ?? i realy need it ..

DementedMindz
09-28-2006, 03:50 PM
how small do you want the images?

Mecho
09-28-2006, 04:13 PM
250 * 300 pixel . and if possible fix the images so that it automaticly shows up in the top left corner of the box .

tnx

DementedMindz
09-28-2006, 04:32 PM
thats a huge image.. you might want to look on vbadvanced to see if anyone resized them that large. personally I would never have them that large on my main page.

Mecho
09-28-2006, 05:14 PM
u know in this site ( link in post #2 ) : http://www.niinterests.com/

all the pics are in 118*112pixel . i think its alitlle small for my job .. if i know the quality of big pics are not going to be low , this size is perfet size . otherwise i think 150*180 PIXEL is great ..

tnx

DementedMindz
09-28-2006, 05:40 PM
no the quality of the pics dont change at all. test it out see how you like it. I use mine for news post this way I can have different images on each news post.

Mecho
09-28-2006, 05:43 PM
ok .. good .. so the size is not important anymore .. i can use this size too ( 118 * 112 ) but how can i make it ? with which code or hack ?

Tnx anyway for ur quick response :)

DementedMindz
09-28-2006, 05:47 PM
it will auto size the image read the thread it explains how to do it.

Mecho
09-28-2006, 06:02 PM
i have read this thread and i did as it said but i it is for attachments images . but in my site no one attach any image .. they just put URL of images in [img] html codes ..

i think if u do me a favor to take ur time and visit my vbadvanced u will see what i exactly mean ..

Tnx
http://mechodownload.com/forum/cmps_index.php

DementedMindz
09-28-2006, 06:41 PM
i know what ur using but i dont think your going to get it any other way with out using the attachments. good luck

Mecho
09-28-2006, 07:28 PM
its so bad for me . caz i cant say to my users that u must attach ur images 2 ur topics :( . so i think if we couldnt make any resizer for this images i think i must go and serach for fix ke height and width of news moudle .
'
tnx anyway :)

imported_infitech
11-28-2006, 07:10 AM
when i use<if condition="!$mod_options['portal_news_legacy']">
<tr>
<td class="thead"><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>
</if>
<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>
<td align="$stylevar[left]" class="alt1" valign="top">

<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>

<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>the images are not aligning to the right when i post an attachment in the forums

DementedMindz
11-29-2006, 10:33 AM
its cause there set to post them to the left look at the code.

imported_infitech
11-29-2006, 07:36 PM
its cause there set to post them to the left look at the code.
it posts on the bottom though. Same as the default attachment look. I want to get rid of the legend and post the on the right or left side even, but only if that specific thread is a thread used by vbadvanced cmps news. u know what i mean?

DementedMindz
11-30-2006, 01:52 AM
its the way you are doing it ill have to look at my settings and see what i have if you read this whole thread it will make it show on your vbadvanced on the left side perfect

fsakbas
12-29-2006, 10:23 PM
Edit the template: adv_portal_newsbits

REPLACE all the code in that template with this code. Don't forget to make a backup of the original beforehand.


<if condition="!$mod_options['portal_news_legacy']">
<tr>
<td class="thead"><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>
</if>
<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>
<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>

<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>


Now when you attach an image to a post in a thread that shows in vbadvanced, the image will show in the top left corner of the post. :D



Thanks a lot . Thats working !