PDA

View Full Version : I've been asking on every vB site... so it's worth a shot...


GTOOOOOH
03-24-2006, 03:01 PM
I want to make a threads title capable of being parsed like a URL, rather then going to it as an actual thread.


In the NewThread Template, I put a check box after the the title/subject, so it looks like this:



<input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" />

<input type="checkbox" name="titleurl" value="yes" id="titleurl" tabindex="1" $checked[titleurl] />Make Title a Link?



Then inside the threadbit template I put an If statement above here:



<if condition="$show['gotonewpost']">
<strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong>
<else />
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a>

</if>



The If statement I wrote was:



<if condition="$checked[titleurl]">
<strong><a href="$thread[threadtitle]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong>
</if>



This doesn't work, in fact all it does is have the checkbox on the newthread template, that's it.

I feel like I'm close, but I'm missing a condition I think, like the if I wrote isn't a real condition, but if it were it WOULD work, or should anyway.

Any help, this could become a new feature for vB I would imagine by making ANY forum a possible links directory. In the future I would attempt to script it so it gets a different icon to indicate that it's a link, and inside the newthread template, if you tick the checkbox then it disables the body of the thread, attachments, polls, etc and forgoes any length checks on the body.

PLEASE?

Greg
03-24-2006, 05:23 PM
Ok, you need to add code to the newthread start hook to recieve your new button info and then put it in the variable you want to use for your conditionals.


$vbulletin->input->clean_gpc('p', 'titleurl', TYPE_BOOL);
$checked[titleurl] = $vbulletin->GPC['titleurl'];


I have no idea about this variable though.
<if condition="$show['gotonewpost']">

So I dunno if that conditional is going to work or not. This should work or give you a clue, but it is not tested.

GTOOOOOH
03-24-2006, 06:15 PM
Nah, didn't work, as for the condtion, the one you mentioned is something in vB already, I mentioned it just as a place holder where I put MY code above. My code was in the last code box.

GTOOOOOH
03-24-2006, 06:25 PM
Actually. Where do I put the code you wrote? Cause it's coming out as text on a newthread page.

Greg
03-24-2006, 08:27 PM
you need to add code to the newthread start hook

I don't have time to code a hack, but ya need a hook. Probably more.