vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Need News!!! Image Alignment Module/hack (https://vborg.vbsupport.ru/showthread.php?t=124264)

soletrader 08-17-2006 11:29 PM

Need News!!! Image Alignment Module/hack
 
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 01:34 PM

Are you using vBadvanced??

If so they can look like THIS

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

DementedMindz 08-19-2006 03:25 PM

project-Buckfas how are you posting different images with each post or you just using bbcode?

project-Buckfas 08-20-2006 12: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 03: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 06: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.

Code:

<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 03: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 01: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 08: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 04: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 04:40 PM

you must be cause its in there. which version are you running?

Insert Username 09-20-2006 05:24 PM

Quote:

Originally Posted by DementedMindz
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 08: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 08: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 10:02 AM

Great idea. I'll have a look later when I get home

DementedMindz 09-21-2006 10: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 04:05 PM

project-Buckfas I was able to get it working great.

postbit_attachmentthumbnail

erase what you have in there and add this.
Code:

<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 04:36 PM

1 Attachment(s)
It works great on vbadvanced, but when I attach an image in a post, the attachment doesn't show.

DementedMindz 09-25-2006 04:37 PM

I havent tried it that way Ill look now and see if I can see why

project-Buckfas 09-25-2006 04:42 PM

Great, thanks DementedMinds

DementedMindz 09-25-2006 04:47 PM

Try this and let me know if it works for you.

Code:

<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 05:03 PM

Thats it! Works a treat.

Thanks for that!

DementedMindz 09-25-2006 05: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 02:47 PM

is that any hack for resize [img]files in vbadvanced ?? i realy need it ..

DementedMindz 09-28-2006 02:50 PM

how small do you want the images?

Mecho 09-28-2006 03: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 03: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 04: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 04: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 04: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 04:47 PM

it will auto size the image read the thread it explains how to do it.

Mecho 09-28-2006 05: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
Code:

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

DementedMindz 09-28-2006 05: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 06: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
Code:

<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

Quote:

Originally Posted by DementedMindz (Post 1127990)
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

Quote:

Originally Posted by project-Buckfas (Post 1057737)
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.

Code:

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


All times are GMT. The time now is 11:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02194 seconds
  • Memory Usage 1,847KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (39)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete