PDA

View Full Version : Attachment link to thread


Nordinho
01-03-2005, 07:50 PM
Heya,

I would like to point the attachment on the frontpage to the thread it's coming from instead of pointing to the full image...I think I should modify the code below,

$attachment = '<a href="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '" target="_blank"><img border="0" height = "190" width = "230" src="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '&amp;stc=1&amp;thumb=1" /></a>';

to something like this??

$attachment = '<a href="' . $vboptions['bburl'] . '/showthread.php?' . $session['sessionurl'] . '$thread[threadid]' . $thread[highlight] . '" target="_blank"><img border="0" height = "190" width = "230" src="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '&amp;stc=1&amp;thumb=1" /></a>';

Am I thinking the right way??

Greets Nordinho,

Brian
01-03-2005, 08:05 PM
$attachment = '<a href="' . $vboptions['bburl'] . '/showthread.php?' . $session['sessionurl'] . 't=' . $news['threadid'] . '" target="_blank"><img border="0" height = "190" width = "230" src="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '&amp;stc=1&amp;thumb=1" /></a>';

Our Sponsors
 

Nordinho
01-03-2005, 08:22 PM
almost ;)...thanks Brian works flawlessly....

Nordinho
08-20-2005, 10:13 AM
almost ;)...thanks Brian works flawlessly....

Any ideas to get this working on 2.0??

Our Sponsors
 

Brian
08-20-2005, 02:33 PM
Change "$vboptions['bburl']" to "$vbulletin->options['bburl']" in each place you see it.

Nordinho
08-23-2005, 01:35 PM
Oke thanks!!

Nordinho
08-26-2005, 11:01 AM
For those with the same problem, the solution above didn't work. I solved it by adding an if condition to the postbit_attachmentthumbnail template...

<if condition="THIS_SCRIPT == 'adv_index'"><a href="vbull/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>

teezdesigns
08-29-2006, 05:14 PM
For those with the same problem, the solution above didn't work. I solved it by adding an if condition to the postbit_attachmentthumbnail template...

<if condition="THIS_SCRIPT == 'adv_index'"><a href="vbull/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>


this worked great for me, thanx!