PDA

View Full Version : Show Thread Enhancements - Show attachments to members only


wolfstream
12-23-2008, 10:00 PM
Now, I know that vb will stop unregistered users from downloading attachments, but here's another quick way to get the attachment itself SHOWN to members only, while letting guests know they're missing something

In postbit_attachment, look for

<tr>
<td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)</td>
</tr>


And replace with:

<tr>
<if condition="$show['member']">

<td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)</td>

<else />
<td> This post has an attachment which you could see if you were <a href="/register.php">registered</a>. Registering is quick and easy</td>
</if>
</tr>


This will let guests know they're missing out on viewing an attachment. Very easy to do!

Allan
12-24-2008, 09:55 AM
humm, nice idea, installed ^^

Charlie98902
12-24-2008, 03:21 PM
Installed as well thanks.

KevinL
12-24-2008, 08:38 PM
heh...I had this in the paid requests like 2 days ago.

Only difference (i think) is that I want guests to see the thumbnail then when clicked it loads to a message/picture saying to registrar...

Tagged. I'll keep an eye on this ;)

wolfstream
12-24-2008, 09:02 PM
Pretty easy to do. I'm assuming you meant something like it is setup here (http://forums.tjwi.info/145-import-adsense-variables-existing-themes.html)?
Didn't get a demo out earlier, as I did this originally for a client (really, it was a 5 second hack) who didn't mind me redistributing it.

to do that, replace postbit_attachment with

<tr>
<td><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<if condition="$show['member']">
<td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)</td>
<else />
<td> This post has an attachment which you could see if you were <a href="/register.php">registered</a>. Registering is quick and easy</td>
</if>
</tr>

KevinL
12-24-2008, 09:16 PM
Oh sorry I was speaking more of image attachments. Like in combination with lytebox.

I guess this could be adapted to that somehow though..hmm I might have to take a look. I was thinking maybe just an <if> statement might get this to work... maybe it will haha

Here was my last post... https://vborg.vbsupport.ru/showpost.php?p=1690026&postcount=461 (you don't have to look at this or do anything with this hahah)

PaiNx
03-24-2009, 03:23 AM
Awesome little template mod and just what I have been looking for...

Thanks:D

Edit: I selected the wrong rating, but I meant to give it a 5 star. Can this be changed?...Sorry

QuackWare
06-29-2009, 01:05 AM
Thanks, exactly what I was looking for.

lm3a.net
08-23-2009, 10:27 AM
thank you,,