PDA

View Full Version : Admins creates threads which are actually links


Admin
04-01-2002, 10:00 PM
Ok this is a really neat idea requested by e_dove here:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=36862

New version![/b]
Now includes links to Delete Thread as well as Stick/Unstick Thread.
If you already installed the hack, open forumdisplay.php and replace this:
if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
}
with this:
$thread['deletelink'] = '';
if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
} else {
$thread['link'] = $thread['link'];
if ($bbuserinfo['usergroupid'] == 6) {
$thread['deletelink'] = "(<a href=\"postings.php?s=$session[sessionhash]&action=deletethread&threadid=$thread[threadid]\">delete</a> | <a href=\"postings.php?s=$session[sessionhash]&action=stick&threadid=$thread[threadid]\">stick / unstick</a>)";
}
}
And in your forumdisplaybit template add $thread[deletelink] after $thread[pagenav].

It gives admins the option to create threads, in any forum, which are actually links to someplace else.
Really basic, when admins create a new thread they have a box to enter URL. If the box isn't empty, whenever the thread is accessed the user will be redirected to that URL.

Using vbHacker as always, edits newthread.php, showthread.php and forumdisplay.php. Adds a field to thread table, creates a new template and edits 2 existing templates.

Have fun. :)

E
04-02-2002, 10:18 AM
Thank you.. and people it doies work.. he tested it on my thread,, ill install tommorow

Admin
04-02-2002, 10:21 AM
Here's an example of this hack:
https://vborg.vbsupport.ru/forumdisplay.php?s=&forumid=13
Click the thread "vBulletin 2.2.5 released".

Mutt
04-02-2002, 10:28 AM
I did this same thing a while ago but never wrote up any directions.

I used the edit thread option of postings.php so you'd have to start a thread then go into postings and edit it to enter the redirect url. It was very simple to add to postings. I used a redirect page to send you to the new url. the views hit counter still works. I made a simple cp script which lists all threads with redirects with edit links. that admins script can also be used to list all stickies, all threads with polls, and all news threads (another hack).

I'd be happy to write it up if you wanted it. I feel the need to contribute since I started using vbhacker. damn handy tool.

snyx
04-02-2002, 02:24 PM
I LOVE IT! Just what I wanted... and vbhacker! *drool*
thanks firefly! anyway you could make my "attachments on calendar events" hack? :D

cheer mate!
-Myles

LouChipher
04-02-2002, 08:02 PM
let's count views?!

E
04-02-2002, 08:43 PM
175...... i installed.. works great :)

nafae
04-02-2002, 11:20 PM
Works fantastic!

er, how do I delete a thread that is a link? :nervous:

E
04-03-2002, 01:49 AM
lol... i was wondering the same....lol... i saw u edited the first thread u tested it on and took the link off it again... may i ask how?

TheCaver
04-03-2002, 03:32 AM
Great hack. Firefly, is it possible to target a new window? If not, it's still a cool hack :)

JC

Admin
04-03-2002, 05:15 AM
nafae: lol I dunno. :p

TheCaver: sure. In forumdisplay.php replace:
if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
}
with:
if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
} else {
$thread['link'] .= '" target="_blank';
}

Parker Clack
04-03-2002, 05:52 AM
Chen:

Yet another cool hack. I too would like to be able to delete a thread that is a link though after it has been up for awhile or you want to edit it.

Parker

Parker Clack
04-03-2002, 06:55 AM
Chen:

I tried using:

if (ismoderator($forumid) or $getperms['canopenclose'] or $getperms['candeletethread'] or $getperms['canmove'] and $thread['link']) {
$admindelete = "<a href=\"/postings.php?s=$session[sessionhash]&action=deletethread&threadid=$thread[threadid]\"><img src=\"delete.gif\" border=\"0\"></a>";
} else {
$admindelete = "&nbsp;";
}

and then just put $admindelete at the end of the hyperlink in the forumdisplay template.

Unfortunately this gives me the delete icon with every thread. I want it to only show up when $thread['link] has something in it. I played around with different items to use for $thread['link] but got nowhere. Any ideas?

Parker

Admin
04-03-2002, 06:57 AM
Put that bit of code BEFORE what my hack adds. :)

Parker Clack
04-03-2002, 07:10 AM
I put it before

if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
}

in forumdisplay.php and it still puts a delete icon after the title of any link. This was one of the first things that I tried.

Parker

Admin
04-03-2002, 07:19 AM
Try in the if to use !empty($thread['link']).

Parker Clack
04-03-2002, 07:31 AM
Ok I tried:

if (ismoderator($forumid) or $getperms['canopenclose'] or $getperms['candeletethread'] or $getperms['canmove'] and !empty($thread['link']))

That didn't work either.

Parker

John
04-03-2002, 01:44 PM
This would be even sweeter if there was a panel at the top of the linked page, saying "Return to forum" or something similar. <drools> :cool:

nafae
04-03-2002, 04:10 PM
Originally posted by JohnWarwick
This would be even sweeter if there was a panel at the top of the linked page, saying "Return to forum" or something similar. <drools> :cool:

And if we could delete threads :p

Admin
04-03-2002, 04:27 PM
I'll add both of these things once I get some time.

John
04-03-2002, 04:50 PM
Originally posted by FireFly
I'll add both of these things once I get some time.

Schweeeet :D We like you :)

Rose
04-03-2002, 05:56 PM
Deletion would be nice.....but this hack is great!

Thanks!

Parker Clack
04-03-2002, 07:21 PM
I tried $thread['link']!="" and that didn't work either.

Thanks again for a great hack.

Parker

TheCaver
04-03-2002, 09:16 PM
Thanks FF, works great!

JC

Zzed
04-03-2002, 09:32 PM
Can you please post a plaintext instructions file?

It would be greatly appreciated. :)

DrkFusion
04-04-2002, 03:28 AM
To delete one link. Has it been done? :)

Parker Clack
04-04-2002, 08:12 AM
DRKfusion:

This is something that is getting worked on.

Parker

69-FLy-gUy
04-04-2002, 02:47 PM
When you do the delete thread option can you add the option to make sticky?

Smoothie
04-05-2002, 10:54 PM
Can someone post the plaintext version here?

Smoothie
04-06-2002, 09:00 AM
Please! Can anyone help here?

Admin
04-06-2002, 10:10 AM
I will post a text version of the hack in the new release.

Jawelin
04-06-2002, 11:58 AM
Isn't the vbhacker export-to-txt function enough affordable ?
:grin:

philliplewisuk
04-06-2002, 02:39 PM
to delete the post goto admin area and then delete the purne etc.

Gutspiller
04-06-2002, 03:23 PM
Would this hack work with 2.0.3?

nafae
04-06-2002, 04:00 PM
Just upload vbhacker, upload the hack, and choose "make text file" and quit whining about it.

Smoothie
04-06-2002, 06:54 PM
Nafae-

If your comment is directed at me, the reason I asked for the text version is because I'm having a problem with vbHacker.

I uploaded the vbhacker.php file to my admin folder. I also uploaded the hack I wanted to install (the hack here)

But when I run the script, it gives me this error:
Warning: Variable passed to reset() is not an array or object in /home/macfora/public_html/forums/admin/vbhacker.php on line 555

Running ver 2.2.2

All I need is the hack in text version so I can install it

kippesp
04-10-2002, 04:21 AM
Parker Clack, for the code in the 13th post, change it to:

$admindelete = "";
if ((ismoderator($forumid) or $getperms['canopenclose'] or $getperms['candeletethread'] or $getperms['canmove']) and $thread['link']) {
$admindelete = "<a href=\"/postings.php?s=$session[sessionhash]&action=deletethread&threadid=$thread[threadid]\"><img src=\"delete.gif\" border=\"0\"></a>";
}

I moved the $admindelete assignment and added some parens.

Small addition to hack:
Like the hack, but I after posting a link I'd rather it not go to the link URL. To instead have the forum displayed, in file "newthread.php" change

if ($visible) {

to

if ($visible and $link=='') {

Smoothie
04-11-2002, 08:18 AM
Originally posted by FireFly
I will post a text version of the hack in the new release. FireFly, any word on this new release?

Thanks

Admin
04-11-2002, 10:06 AM
Sorry I forgot, basically all the new version has it a delete link and someone already posted that but I'll post my version anyway later.

Admin
04-11-2002, 11:12 AM
And here's the text version of the new update...

amykhar
04-11-2002, 03:11 PM
Chen,
Could a template be created that consists of two frames. The top frame would be a frame for a link back to our board. The bottom frame would be the external page that we linked to. Then, instead of calling the refresh to the new page, your hack would refresh to a script that took the link as a parameter, and then displayed the framed page template?

Sorry if that is confusing.
Amy

TECK
04-11-2002, 03:55 PM
this is a great idea. specially for a VB powered frontpage. you could use an invisible forum and grab the list of threads with a query.
thanks firefly for this cool hack. :)

-=dm=-
04-11-2002, 04:02 PM
FireFly you da king!!

thanx :)

amykhar
04-11-2002, 06:30 PM
Never mind, Chen. I got it. :D

Amy

Smoothie
04-12-2002, 02:47 AM
Great hack this is. I'm using it together with c-prOmpt's excellent hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36600)
Thanks again FireFly.

Parker Clack
04-12-2002, 09:24 PM
Chen:

I added the ability to Edit the Title of the link too using

$thread['deletelink'] = "<br>( <a href=\"postings.php?s=$session[sessionhash]&action=deletethread&threadid=$thread[threadid]\"> Delete</a> | <a href=\"postings.php?s=$session[sessionhash]&action=stick&threadid=$thread[threadid]\">Stick | Unstick</a> | <a href=\"postings.php?s=$session[sessionhash]&action=editthread&threadid=$thread[threadid]\"> Edit Title</a> )";

Is there anyway to write this so that when you do post a new thread and use the title to go to a different url where it goes back to the original thread (when you first post it) instead of going to the new link?

Parker

kippesp
04-13-2002, 02:19 AM
Originally posted by Parker Clack
Is there anyway to write this so that when you do post a new thread and use the title to go to a different url where it goes back to the original thread (when you first post it) instead of going to the new link?

In file newthread.php, find:
} elseif ($visible) {
and replace with:
} elseif ($visible and $link=='') {

Parker Clack
04-13-2002, 03:42 AM
kippesp:

Thanks. I tried that before but I guess I put it in wrong. It is working great now.

Parker

Ghostsuit
04-16-2002, 11:18 AM
The ability to make the link a stick would be great. Is that planed?

!!!cyr0n_k0r
04-20-2002, 05:41 PM
you have horriable install instructions for n00bs.

a readme laying out the steps would really be nice.

Jawelin
04-26-2002, 12:11 PM
FireFly, I installed this hack correctly but when i create a new thread and fill the url field, actually doesn't happen anything....
:(

FoA, the URL text field at first time contains the string \"\" ... is it normal ?

Actually, I verified by phpMyAdmin, the thread row has the 'link' field empty.
I double-checked in particular the hack applied to newthread.php but everything seems well done... :(

Thank you for any help.

Jawelin
04-26-2002, 12:38 PM
Originally posted by Jawelin
FoA, the URL text field at first time contains the string \"\" ... is it normal ?

Thanks. Solved myself.
As you can see, I used the txt version output of vbhacker procedure... with the known problem of '"\' ... I made the correction to the new template and everything went fine. Probably that double slash/quote created some kind of problem when writing the url into db...
Now it's ok.

Thanks again.

Russ
05-29-2002, 10:49 AM
Would be good to know how you did that.. because I'm having the same problem.

details :)

Russ
05-29-2002, 11:29 AM
Just figured it out before the PM came from you :)

So here tis.

You need to change your newthread_linkoption to this:
Link this thread to: <input type="text" name="link" value="$link" class="bginput" size="40"><br>

Enjoy.

Boofo
06-01-2002, 01:05 PM
I just installed the vbhacker version of this and I must have missed something. Where is the box to put the URL in? And where is the delete button for the link? Can someone please tell me what I missed or am missing?

Allstar DC
06-02-2002, 09:06 PM
Originally posted by Boofo
I just installed the vbhacker version of this and I must have missed something. Where is the box to put the URL in? And where is the delete button for the link? Can someone please tell me what I missed or am missing?


Same problem here

Allstar DC
06-02-2002, 09:46 PM
ok, fixed!

i found a lil bug, it doesn't update the "new thread" template
the hack searches for this line but thats wrong!! <input type=\"checkbox\" name=\"parseurl\" value=\"yes\" $parseurlchecked> <b>Automatically parse URLs:</b> automatically adds and around internet addresses.


to make this hack work do the following, search for this line in your "new thread" template:

<input type="checkbox" name="parseurl" value="yes" $parseurlchecked> <b>Automatically parse URLs:</b> automatically adds [ url ] and [ /url ] around internet addresses.

and replace it with this:
$linkoption
<input type="checkbox" name="parseurl" value="yes" $parseurlchecked> <b>Automatically parse URLs:</b> automatically adds [ url ] and [ /url ] around internet addresses.

remove the spaces between [ url ] and [ /url ]

next open the newly created "newthread_linkoption" template

and replace the coding with this:
Link this thread to: <input type="text" name="link" value="$link" class="bginput" size="40"><br>

ok, now it will work

kippesp
06-04-2002, 03:10 AM
This modification to postings.php will prevent sticking/unsticking
a thread-which-is-a-link from going to the link URL when
the stick/unstick action is performed.

Find: eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
and replace with: if (empty($threadinfo['link'])) {
eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
} else {
eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]\");");
}


Regarding sticking/unsticking...I was seeing an error message
with this and found it could be eliminated by using session[dbsession]
in the URL for when the thread is stuck/unstuck. My forum didn't
like me browsing with cookies I guess.

Boofo
06-04-2002, 09:15 AM
You lost me here on this one and on the dbsession part. :)

Originally posted by kippesp
This modification to postings.php will prevent sticking/unsticking
a thread-which-is-a-link from going to the link URL when
the stick/unstick action is performed.

Find: eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
and replace with: if (empty($threadinfo['link'])) {
eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
} else {
eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]\");");
}


Regarding sticking/unsticking...I was seeing an error message
with this and found it could be eliminated by using session[dbsession]
in the URL for when the thread is stuck/unstuck. My forum didn't
like me browsing with cookies I guess.

kippesp
06-04-2002, 04:58 PM
Originally posted by Boofo
You lost me here on this one and on the dbsession part. :)



I think only I and Parker Clack didn't like certain things regarding managing
these types of threads. I had an earlier modification to prevent the
following: after initially creating the link thread, vB goes to the thread view
but is redirected to the link. My preference is to go to the forum view.
Firefly for whatever reason didn't use this in his latest update.

My last post fixed a similar situation I didn't like. This with regard to
sticking/unsticking the link thread. Same scenerio: if I stick an unstuck
thread, vB goes to the thread view but is redirected to the link. My code
modifications change that to the way I prefer.

As far as that last bit, that was too vague--sorry. I don't know if I put the
hack in incorrectly or I have a browser problem. But if I am browsing with
cookies (where only 's=' without the sessionidi shows up in my address bar),
trying to use the stick/unstick link takes me to an error window: Your
session appears to be invalid. Click here to create a new session. If I
browse without cookies, no error message. But I can eliminate the error all
the time with the following code change in forumdisplay.php (taken from
Firefly's first post).
$thread['deletelink'] = '';
if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
} else {
$thread['link'] = $thread['link'];
if ($bbuserinfo['usergroupid'] == 6) {
$thread['deletelink'] = "(<a href=\"postings.php?s=$session[sessionhash]&action=deletethread&threadid=$thread[threadid]\">delete</a> | <a href=\"postings.php?s=$session[dbsessionhash]&action=stick&threadid=$thread[threadid]\">stick / unstick</a>)";
}
}

Only a single word is changed: sessionhash-->dbsessoinhash.

I was a bit surprised no one has mentioned similar situations.
But this would corrected it if they did.

Jeremy W.
06-05-2002, 12:29 AM
I've installed it (no problems with the install), but ... well, it hasn't changed anything...

I mean, I go to start a new thread and there isn't any box. Am I dense or just thick? *L*

Allstar DC
06-05-2002, 03:43 AM
Jeremy W. :

Check (post #57) in topic, the fix is posted there

Jeremy W.
06-05-2002, 10:21 AM
Great, thanx :)

Birdie501
06-12-2002, 12:17 AM
Originally posted by FireFly

TheCaver: sure. In forumdisplay.php replace:
if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
}
with:
if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
} else {
$thread['link'] .= '" target="_blank';
} [/B]

if i put this code to forumdisplay.php i have the following and get a parse error???


if (empty($thread['link'])) {
$thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
} else {
$thread['link'].= '" target="_blank';
} else {
$thread['link'] = $thread['link'];
if ($bbuserinfo['usergroupid'] == 6) {
$thread['deletelink'] = "(<a href=\"postings.php?s=$session[sessionhash]&action=deletethread&threadid=$thread[threadid]\">l?schen</a> | <a href=\"postings.php?s=$session[sessionhash]&action=stick&threadid=$thread[threadid]\">fix / unfix</a>)";
}
}


What's the problem?

Dan Flynn
09-28-2002, 02:45 AM
I have this installed but get this error. Any ideas?

Thanks

Parse error: parse error, unexpected $ in /home2/powerwas/public_html/showthread.php on line 604

somerfeld
10-03-2002, 01:50 AM
can i see some screen shots or something?

Smoothie
10-03-2002, 06:38 AM
Screen shots? It looks like a thread link, but when you click it, it takes you to whatever the link is. There's nothing to see.....

Antorz
10-15-2002, 01:38 AM
I'm also missing all the content in newthread_linkoption

it's linked from newthread w/ $linkoption

and I did all the changes suggested in post #57 of this thead...

do I have my permission wrong or something? I'm testing it using the admin account, with nothing showing up..

Thanks for any help

Mono
11-02-2002, 04:34 AM
I installed this hack and it gave me a bunch of errors so I tried to work my way backwards in the hack but decided to freshly install the phps.

Anyway now my thread links link back to the main page and I cant think of how to get them to show the thread anymore :/.

I really need help soon because we have some 3000 plus members and people want to use the board. Any help would be appreciated. Im thinking it has to do with the ALTER TABLE thread ADD link varchar(255) NOT NULL part of the hack because when I go to manuel mode it shows up blank.

Mono
11-02-2002, 05:09 AM
Fixed the problem.

-_- it was the forumbits template I forgot to revert .... god I feel like a noob.

Sharg
04-24-2003, 01:58 AM
Hello,
does this hacks works with vb 2.3 ?

Also, will there be no troubles when updating to 3.0 since this hack alter the database ?

Thanks,
Sharg

vB-Host.com
04-25-2003, 06:53 AM
how can I make a forum id rather then a thread id linkable? So I can make a link kinda like vb.com does in the forums for vb.org and .org does for .com

Erwin
04-25-2003, 07:21 AM
Today at 05:53 PM vB-Host.com said this in Post #72 (https://vborg.vbsupport.ru/showthread.php?postid=386796#post386796)
how can I make a forum id rather then a thread id linkable? So I can make a link kinda like vb.com does in the forums for vb.org and .org does for .com


This is asked every other day here at vB.org it seems. :) Use the search feature in future.

It's easy - when editing a forum, put this in as the Forum Title:

</a><a href="http://www.google.com">Click here to go to Google!</a>

And the forum will redirect to Google.

There is a hack that can do this too. Do a search in Hack Requests for other variations and extensions.

cinq
04-25-2003, 11:25 AM
So does this hack work on 2.2.9 ?

vB-Host.com
04-25-2003, 05:48 PM
Today at 05:25 AM cinq said this in Post #74 (https://vborg.vbsupport.ru/showthread.php?postid=386905#post386905)
So does this hack work on 2.2.9 ?

yes! flawless install of both vbhacker and this hack on first try... no errors! but be sure to see a post in here.. I beleive post #58 about code changes in 2 of the templates.

http://www.vb-host.com/forum/forumdisplay.php?s=&forumid=13 My site uses 2.2.9 and the sticky click here to go to our help desk is a link using this hack

There is a hack that can do this too. Do a search in Hack Requests for other variations and extensions.

Thanks Erwin... Didn't think about just putting the URL as the forum name.. as for searching.. I tried a bunch of different keywords but only this hack came back to anything close.

cinq
04-26-2003, 02:16 AM
thanks vbhost for the confirmation, will be installing this hack soon. :)

Nice site btw, hope it becomes busy soon :D

vB-Host.com
04-26-2003, 02:40 AM
[i]Today at 08:16 PM cinq thanks vbhost for the confirmation, will be installing this hack soon. :)

Nice site btw, hope it becomes busy soon :D

Glad I can help :) Thanks, glad you liked my site... It has been getting a lot of intrest.. The site will be fully completed this weekend.. Of course you need to register to see most of the hacks I installed *grin*

Bison
08-22-2003, 05:59 PM
I just installed this hack but when I create a thread and enter the link information, it take me into the threa I created. I know I did this right and went through all fo the code several times and still I get nothing but entry into the thread I created...

StrykerContact
08-24-2003, 06:23 AM
Uhh I really am a Noob sorry, how the hell do you install this one, there is no instructions. Sorry if I missed somthing or if this is just a noob question. Please help though thanks ^^.

fn9mm
11-09-2005, 07:28 PM
Any update on this??

Possible in 351?

lexx27
11-19-2006, 04:47 PM
I want that too for 3.6