vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Local links to titles (https://vborg.vbsupport.ru/showthread.php?t=69077)

JohnWoo 09-03-2004 10:00 PM

Local links to titles
 
Hello!

Not sure again - may be something like it exist already, but I was not able to find :)
That small hack adds only one feature. Links to local board posts, threads and forums will appear on that threads and post titles. For example link text for
https://vborg.vbsupport.ru/showthrea...2&goto=newpost
will be turned to "Fulltext boolean search v.2.2 for vB" and on https://vborg.vbsupport.ru/forumdisplay.php?f=32 - to "Code Modifications vB3".
But please be careful - it adds additional DB request for each local link on page.

Fixes:
v 1.1

- fixed links to multiply pages threads with pp= in url

nexialys 09-04-2004 12:03 PM

i always dreamed of this, but never took a look at the code.. lol

btw, GREAT!

BarHopper 09-04-2004 12:32 PM

Wow,l this is great,. Thanks

Dean C 09-04-2004 04:44 PM

Thankyou for sharing your work with the community :)

ranger2kxlt 09-04-2004 05:31 PM

I'm lost as to what this does? Can someone explain a bit more?

Thanks

roundhost 09-04-2004 05:37 PM

wicked cool!

Mike11212 09-04-2004 08:36 PM

Quote:

Originally Posted by ranger2kxlt
I'm lost as to what this does? Can someone explain a bit more?

Thanks

Basically when someone post a link to a thread the link will turn into a text link. The text being the threads title.

ChurchMedia 09-05-2004 04:39 AM

Nice! *installs

Small bug that I'm sure you can fix. If you use a link that came from (for instance) a page 3 of a thread, you get a "Post not found". This link won't work:

I think it's because of the &page=3&pp=15.

I'm sure you can fix it up :)

JohnWoo 09-05-2004 04:55 AM

yes.. sorry - it is because of pp=15
to fix it just replace
Code:

if (preg_match("~p=([0-9]+)~", $rightlink, $num)) {
with
Code:

if (preg_match("~[^a-z]p=([0-9]+)~", $rightlink, $num)) {
:)
i'll upload new zip in few minutes

ChurchMedia 09-05-2004 05:14 AM

Perfect! Works great now.

Thanks!!! :)

CarCdr 09-05-2004 11:45 AM

John,

A few comments from only reading the code.

* The implementation should never return an error message instead of a link. If I post a link and you find that I do not have access or you could not find the post, the code should fall through to behave as it would without this mod -- i.e., just leave the link alone.

* Are you replacing all instances of "forumid", "threadid", and "postid" with "f", "t", and "p"?
This would mangle a mod with those strings anywhere else in the URL, like "/my_mod_forumid.php?p=1234".

* Access to a thread/post should be CANVIEWOTHERS if one is not the author.

* You seem to be checking a URL for "p=" first and then overwriting the results if "t=" is found in the same URL. Perhaps you are missing an 'else'.

* You could think about using the post title (p=1234 case) when it is set (i.e., not the thread title).

* "showpost.php" case would be useful and is very similar to "showthread.php" case.



Also, this may give you some other ideas:
https://vborg.vbsupport.ru/showthread.php?t=68398

Cheers

JohnWoo 09-05-2004 01:29 PM

Completely agree with everything - it was just fast "weekend idea" and far from perfect :)
May be except "post title" - i still think that thread title will always give better description for link.
I'll make and upload v1.2 as soon as I'll have free time again :) But one question - sorry :)
I never was vb3 administrator and have no working vb3 near, so can you please give example url with both "p=" and "t=" variables?

CarCdr 09-05-2004 01:54 PM

t= and p= in same URL
I was mistaken. Although they can both appear in a showthread URL, the t= will override.

Nevertheless, you likely still need an else between the t= and p= code.

Also, I would guess that most people likely want local links to open in the same window. A config option would be a good idea here.

ChurchMedia 09-05-2004 06:37 PM

Sorry :(. I found another bug. When parsing a URL to a member user, it creates a link like: member.php?u=1234 and drops out the name of the user. You can see an example here: http://www.churchmedia.net/community...ead.php?t=5100

Edit: I uninstalled the hack and resaved the post above and it fixed it, so it doesn't show the problem anymore. Just try this in a post and see what you get:
Code:

[ url=http://www.churchmedia.net/community/forum/member.php?u=1]Tim Eason[/url ]

(spaces in url so it won't parse in this post)

Maybe you need some definition for u=xxxx?

Also, I agree that you should make the url just show up as-is instead of giving a "post not found" error. That would take care of potential problems.

Great concept :)

JohnWoo 09-06-2004 07:42 AM

i'll add everything and fix exerything tomorrow :)
sorry - too busy today...

Phalynx 09-06-2004 10:10 AM

great!

Erwin 09-06-2004 12:09 PM

Good idea. How's the server load affected for those using this on a busy site?

cinq 12-06-2004 11:28 AM

what happens when someone uses the
Code:

[url =link]text[ /url] tags instead ?

robertuss 12-09-2004 05:06 PM

How about rewriting a posted text when a user inserts a reply?
I mean really change a http://www.blabla....-Textpart into a valid vbCodelike:{url=http://www.blablabl]Thread name[/url] and store that in the users post in the text.

This would easy the load for larger boards (no on-the-fly checks necessary).

Sebastian 12-28-2004 03:08 PM

this hack has more bugs than windows 95,98,2000 and xp combined. ;)

amykhar 12-28-2004 03:17 PM

Quote:

Originally Posted by Sebastian
this hack has more bugs than windows 95,98,2000 and xp combined. ;)

well, then help fix them for heaven's sake. The author contributed his idea and work for free. It's a jumping off point for us to use and not a chance to snipe at him because it has glitches.

Hack authors share their work to be nice. If you all continue to whine and complain rather than chip in and make improvements, nobody's going to share their code anymore. It's too much like a job with a micromanaging boss and really bad pay.

amykhar 12-28-2004 06:33 PM

Question - to save queries, why not do the coversion at the time the user posts the link either as a new post or when editing an existing post?

If I understand the way it now works, it's going through when the thread is displayed and changing it at that point. I just glanced at the code though, so I may be wrong.

Amy

Sebastian 12-29-2004 03:42 AM

yea.. you're right.. it process the urls when they are displayed along with the post.. so if a user post 2 links to a thread it will perform 2 queries.. the idea of changing the urls before posting would seem a lot more logical.. i'll look into redoing this hack since i had plans to do this even before i saw this hack.

my only gripe with hacks like these is they belong in the beta section..

MajorFm.com 10-18-2005 02:55 PM

great hack, i have subscribed to this thread and look forward to a version that takes out the query


All times are GMT. The time now is 01:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01083 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete