Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Admins creates threads which are actually links Details »»
Admins creates threads which are actually links
Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-01-2002 Last Update: Never Installs: 37
 
No support by the author.

Ok this is a really neat idea requested by e_dove here:
https://vborg.vbsupport.ru/showthrea...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:
Code:
    if (empty($thread['link'])) {
        $thread['link'] = "showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]";
    }
with this:
Code:
	$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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 04-26-2002, 12:11 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #53  
Old 04-26-2002, 12:38 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #54  
Old 05-29-2002, 10:49 AM
Russ Russ is offline
 
Join Date: Nov 2001
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would be good to know how you did that.. because I'm having the same problem.

details
Reply With Quote
  #55  
Old 05-29-2002, 11:29 AM
Russ Russ is offline
 
Join Date: Nov 2001
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just figured it out before the PM came from you

So here tis.

You need to change your newthread_linkoption to this:
PHP Code:
Link this thread to: <input type="text" name="link" value="$linkclass="bginput" size="40"><br
Enjoy.
Reply With Quote
  #56  
Old 06-01-2002, 01:05 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #57  
Old 06-02-2002, 09:06 PM
Allstar DC Allstar DC is offline
 
Join Date: Apr 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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
Reply With Quote
  #58  
Old 06-02-2002, 09:46 PM
Allstar DC Allstar DC is offline
 
Join Date: Apr 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, fixed!

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

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

PHP Code:
        <input type="checkbox" name="parseurl" value="yes" $parseurlchecked> <b>Automatically parse URLs:</bautomatically adds url ] and [ /url around internet addresses
and replace it with this:
PHP Code:
         $linkoption
        
<input type="checkbox" name="parseurl" value="yes" $parseurlchecked> <b>Automatically parse URLs:</bautomatically 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:
PHP Code:
Link this thread to: <input type="text" name="link" value="$linkclass="bginput" size="40"><br
ok, now it will work
Reply With Quote
  #59  
Old 06-04-2002, 03:10 AM
kippesp kippesp is offline
 
Join Date: Jan 2002
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Code:
  eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
and replace with:
Code:
   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.
Reply With Quote
  #60  
Old 06-04-2002, 09:15 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You lost me here on this one and on the dbsession part.

Quote:
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:
Code:
  eval("standardredirect(\"".gettemplate("redirect_sticky")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
and replace with:
Code:
   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.
Reply With Quote
  #61  
Old 06-04-2002, 04:58 PM
kippesp kippesp is offline
 
Join Date: Jan 2002
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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).
Code:
	$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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06175 seconds
  • Memory Usage 2,337KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (5)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete