vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - Collapsable First Post using AJAX (or Last Post!) (https://vborg.vbsupport.ru/showthread.php?t=145187)

jasculs 07-06-2007 05:25 AM

The mod is great!

However it doesn't work with the "Hide Links From Guest" mod:

https://vborg.vbsupport.ru/showthread.php?t=123415

Guests are able to see the links in the ajax post. Anything I can do to make it work?

magnus 07-06-2007 10:47 AM

Quote:

Originally Posted by jasculs (Post 1284139)
The mod is great!

However it doesn't work with the "Hide Links From Guest" mod:

https://vborg.vbsupport.ru/showthread.php?t=123415

Guests are able to see the links in the ajax post. Anything I can do to make it work?

Right off the bat, I'd say you'd just need to run whatever regular expression match/replace he's probably using against the returned message value.

It's something I can look at when I get some time.

jasculs 07-06-2007 01:16 PM

Quote:

Right off the bat, I'd say you'd just need to run whatever regular expression match/replace he's probably using against the returned message value.
I don't quite understand really. Anyway you can give an example. Would that require a plugin for me to add? I'm ok with finding things in the code, but I'm not sure what I should look for as far as a regular expression match/replace.

magnus 07-06-2007 02:37 PM

In one of the plugins for the link hack, you'll most likely find a bit of code that does all the processing you're looking for. Something that uses a regexp to match for http then replaces it with the specified phrase.

Taking that bit of code, and placing it in vbpost_ajax.php where the message text is retrieved should yield the desired result.

Invalid ID 07-06-2007 02:53 PM

Amazing

jasculs 07-06-2007 03:52 PM

Quote:

Originally Posted by magnus (Post 1284410)
In one of the plugins for the link hack, you'll most likely find a bit of code that does all the processing you're looking for. Something that uses a regexp to match for http then replaces it with the specified phrase.

Taking that bit of code, and placing it in vbpost_ajax.php where the message text is retrieved should yield the desired result.

Would what your talking about be in this plugin somewhere? This is the plugin that hides the links in the posts. If it is in here can you point it out for me and maybe tell me where to put in the vbpost_ajax.php file? I would really appreciate it.

Code:

if (ereg("(showthread)", $GLOBALS[vbulletin]->scriptpath))
{
        if ($this->registry->options['hlfg_global'])
        {
                $groups = explode(',',$this->registry->options['hlfg_groups']);
                if ($this->registry->options['hlfg_posts'] AND !$this->registry->userinfo['userid'] OR $this->registry->options['hlfg_posts'] AND (is_member_of($this->registry->userinfo, $groups) OR $groups[0] == 0))
                {
                        if (!$forum['forum_hlfg'])
                        {
                                $pattern = '/(<a.*?<*a>)/';
                                $message_array = preg_split($pattern, $this->post['message'], 65535, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

                                if ($this->registry->options['hlfg_misc'] == '')
                                {
                                        $this->registry->options['hlfg_misc'] = "\e";
                                }

                                $ugids = explode(',',$this->registry->options['hlfg_ugids']);
                                if ($ugids[0] == '')
                                {
                                        $ugids[0] = '0';
                                }

                                foreach($message_array as $message_key => $message_value)
                                {
                                        if (!preg_match("/" . $this->registry->options['hlfg_misc'] . "/", $message_value) AND (!strstr($this->registry->options['hlfg_users'], $post[musername])) AND ($post['userid'] != $this->registry->userinfo['userid'] OR !$this->registry->options['hlfg_own']) AND (!is_member_of($post['usergroupid'], $ugids)))
                                        {
                                                $message_array[$message_key] = preg_replace("!<a[^>]*(http|www|mailto)(.*)</a>|\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b!siU", $this->registry->options['hlfg_info'], $message_value);
                                        }
                                }
                                $this->post['message'] = implode("", $message_array);
                        }
                }
        }
}


magnus 07-06-2007 05:14 PM

Yep, that looks like it. I had hoped it would've been contained within a function, as that would've been ideal -- however, that will work.

Try this:

Open up vbpost_ajax.php, look for:
PHP Code:

//if ($_SERVER['REQUEST_METHOD'] == 'POST' AND 

Above it, paste the following:
PHP Code:

    if ($vbulletin->options['hlfg_global'])
    {
        
$groups explode(',',$vbulletin->options['hlfg_groups']);
        if (
$vbulletin->options['hlfg_posts'] AND !$vbulletin->options['userid'] OR $vbulletin->options['hlfg_posts'] AND (is_member_of($vbulletin->userinfo$groups) OR $groups[0] == 0))
        {
            if (!
$foruminfo['forum_hlfg'])
            {
                
$pattern '/(<a.*?<*a>)/';
                
$message_array preg_split($pattern$post['message'], 65535PREG_SPLIT_DELIM_CAPTURE PREG_SPLIT_NO_EMPTY);

                if (
$vbulletin->options['hlfg_misc'] == '')
                {
                    
$vbulletin->options['hlfg_misc'] = "\e"
                }

                
$ugids explode(',',$vbulletin->options['hlfg_ugids']);
                if (
$ugids[0] == '')
                {
                    
$ugids[0] = '0';
                }

                foreach(
$message_array as $message_key => $message_value)
                {
                    if (!
preg_match("/" $vbulletin->options['hlfg_misc'] . "/"$message_value) AND (!strstr($vbulletin->options['hlfg_users'], $post[musername])) AND ($post['userid'] != $vbulletin->userinfo['userid'] OR !$vbulletin->options['hlfg_own']) AND (!is_member_of($post['usergroupid'], $ugids)))
                    {
                        
$message_array[$message_key] = preg_replace("!<a[^>]*(http|www|mailto)(.*)</a>|\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b!siU"$vbulletin->options['hlfg_info'], $message_value);
                    }
                }
                
$post['message'] = implode(""$message_array);
            }
        }
    } 

Keep in mind I haven't had a chance to test this, so I'd suggest backing up your original vbpost_ajax.php. Let me know if that works, if not, when I get some free time I'll install the links hack on my test forum.

jasculs 07-06-2007 05:21 PM

That worked except it blocked the links for everyone, not just guests. Anyway I can add a condition or something so it just blocks it for unregistered users only? Thanks for the help.

alessai 07-06-2007 05:22 PM

magnus.... could yo see my suggestion ? and is it possible?

magnus 07-06-2007 07:04 PM

Quote:

Originally Posted by alessai (Post 1284510)
magnus.... could yo see my suggestion ? and is it possible?

I need more information before I could even remotely begin to address your question. For example, a link to whichever modification you're trying to use in conjuction with this one.

magnus 07-06-2007 07:10 PM

Quote:

Originally Posted by jasculs (Post 1284508)
That worked except it blocked the links for everyone, not just guests. Anyway I can add a condition or something so it just blocks it for unregistered users only? Thanks for the help.

Here, FIND:
PHP Code:

if ($vbulletin->options['hlfg_global']) 

REPLACE with:
PHP Code:

if ($vbulletin->options['hlfg_global'] && !$vbulletin->userinfo['userid']) 

That should do it.

jasculs 07-06-2007 07:21 PM

You are seriously the best. I'll be sure to make a donation soon. Thanks!

alessai 07-06-2007 10:35 PM

Quote:

Originally Posted by magnus (Post 1284593)
I need more information before I could even remotely begin to address your question. For example, a link to whichever modification you're trying to use in conjuction with this one.

:) here is the problem i use more than one (and 2 of them are not here) ,,, so my suggestion is to add an option to choose which groups can use this feature :up:

AcidX 07-10-2007 11:27 PM

Works just great! Installed.
Damn I love AJAX! ;)

cuphongle 07-12-2007 05:49 AM

after i uninstalled it, my "what's going on" on the forum page is slanted to the right.

here's the image

http://i17.tinypic.com/4ke21sg.jpg

magnus 07-12-2007 10:42 AM

Quote:

Originally Posted by cuphongle (Post 1288925)
after i uninstalled it, my "what's going on" on the forum page is slanted to the right.

here's the image

http://i17.tinypic.com/4ke21sg.jpg

This modification has absolutely no effect on the area you're having problems with whether installed or uninstalled.

baghdad4ever 07-14-2007 08:34 PM

installed

but can i make the hack apear only to Registered Users

and doesnt apear to Unregistered

GrendelKhan{TSU 07-20-2007 03:13 AM

weird...had the original vefsion installed on my vb3.6.0 board...
but I FINALLY got around to updating it...and so updated this as well.

problem is: for some reason the FIRST UNREAD and LAST post choices don't seem to work. FIRST post works. I want to use Last post.

:( any suggestions?

EDIT: nevermind. working now. ghost in the machine +_+ heh

raiderlax 07-23-2007 06:03 AM

Quote:

Originally Posted by magnus (Post 1283733)
Well, off the bat, it doesn't appear you've actually installed the modification. The files jquery.js and vbulletin_vbpost.js are not present in your /clientscript/ directory. Nor are any of the associated image files located in the correct directories.

So, either you didn't install the modification correctly or you removed it. Both which prevent me from being able to find out what the problem is based off the description of "nothing shows up".

Hi, sorry, I have installed it back now, it looks like it's installed correctly, but when you go to expand it it just keeps circling and doesn't actually open it.

See on my site, thanks.

magnus 07-23-2007 12:02 PM

Quote:

Originally Posted by raiderlax (Post 1298800)
Hi, sorry, I have installed it back now, it looks like it's installed correctly, but when you go to expand it it just keeps circling and doesn't actually open it.

See on my site, thanks.

The file vbpost_ajax.php is not located in your forum's root directory. When uploaded properly, it should be found at http://talkfitness.org/vbpost_ajax.php

raiderlax 07-23-2007 06:58 PM

Wow, man thanks alot it works awesome now :)

Coldhands 08-08-2007 04:21 PM

Is it possible to condense the clientscript/jquery.js file? Is every function in that library being used for this hack or is there a lot of fat in this code?

What functions in clientscript/jquery.js can we do without?????? I'm just sayin, 61k of js is a lot just to show the first post.

magnus 08-08-2007 05:38 PM

Feel free to edit whatever you like from the jquery.js file. I can't distribute it if I modify it.

Coldhands 08-08-2007 10:55 PM

I've deleted my post, in hopes of eliminating all evidence that I am in fact retarded. :tin-foil-hat:

Coldhands 08-08-2007 11:55 PM

Quote:

Originally Posted by magnus (Post 1312894)
Feel free to edit whatever you like from the jquery.js file. I can't distribute it if I modify it.

I think you may be misinterpreting the license, not that the jquery police would be knocking on your door anytime soon. :D

JQuery offers a compressed version that you can download from the Google Gods here >> http://code.google.com/p/jqueryjs/do....1.3.1.pack.js

jquery-1.1.3.1.pack.js works the same as the clientscript/jquery.js in the download for this hack, but it's only 1/3 the size. Just rename jquery-1.1.3.1.pack.js to jquery.js and overwrite the clientscript/jquery.js that came with this hack.

The js file in the download is made for humans to read, develop and debug; the code I linked to is for production. If you're feeling saucy, you could even trim that one down a bit. When you go through 300 gigs a month, every little bit counts.

P.S. Thanks for the great hack and quick response Magnus. :up:

mtlcore 08-09-2007 01:09 AM

Nice hack dude.

One thing though, I install it, works fine on Default template. Doesn't show up on my custom template. Even did the template edits (turned off auto edits too). Still nothing. :(

magnus 08-09-2007 11:00 AM

Quote:

Originally Posted by mtlcore (Post 1313212)
Nice hack dude.

One thing though, I install it, works fine on Default template. Doesn't show up on my custom template. Even did the template edits (turned off auto edits too). Still nothing. :(

You're probably using a custom image directory. You'll need to copy the images to that dir as well.

magnus 08-09-2007 11:01 AM

Quote:

Originally Posted by Coldhands (Post 1313174)
I think you may be misinterpreting the license, not that the jquery police would be knocking on your door anytime soon. :D

JQuery offers a compressed version that you can download from the Google Gods here >> http://code.google.com/p/jqueryjs/do....1.3.1.pack.js

jquery-1.1.3.1.pack.js works the same as the clientscript/jquery.js in the download for this hack, but it's only 1/3 the size. Just rename jquery-1.1.3.1.pack.js to jquery.js and overwrite the clientscript/jquery.js that came with this hack.

The js file in the download is made for humans to read, develop and debug; the code I linked to is for production. If you're feeling saucy, you could even trim that one down a bit. When you go through 300 gigs a month, every little bit counts.

P.S. Thanks for the great hack and quick response Magnus. :up:


I'll look at that, thanks. :)

cheekymonk3y 08-12-2007 12:21 AM

Quote:

Originally Posted by magnus (Post 1313502)
You're probably using a custom image directory. You'll need to copy the images to that dir as well.

woot, that fixed mine as well, you should change it if you can to just look in the parent image directory instead of the style's directories. :P

magnus 08-12-2007 03:26 PM

Quote:

Originally Posted by cheekymonk3y (Post 1315540)
woot, that fixed mine as well, you should change it if you can to just look in the parent image directory instead of the style's directories. :P

It properly uses the $stylevar[imgdir_{x}] variables. Changing it to anything other would cause breakage for others.

utw-Mephisto 08-18-2007 02:06 PM

I installed it on a test forum and the "+" doesn't show .. I don't have ` custom image folder tho and I cross checked that all files are on the server :(

RaceJunkie 08-18-2007 02:09 PM

When I do a search for new posts and the results are returned,(Don't know the actual template) I click on the + and it shows the first post instead of last. In FORUMDISPLAY when I click the + the last post is showed like it should be. I have it set to show Last post. Has this been a problem for anyone else?

Thanks for this great mod.

utw-Mephisto 08-18-2007 02:25 PM

Quote:

Originally Posted by utw-Mephisto (Post 1320282)
I installed it on a test forum and the "+" doesn't show .. I don't have ` custom image folder tho and I cross checked that all files are on the server :(

I even reverted all templates now - same problem :(

magnus 08-20-2007 11:15 AM

Quote:

Originally Posted by utw-Mephisto (Post 1320303)
I even reverted all templates now - same problem :(

  1. Are you using the default templates?
  2. What version of vBulletin are you using?

If you can answer yes to 1 and 3.6.x to 2, I'll need your forum URL before I can do much more.

magnus 08-20-2007 11:16 AM

Quote:

Originally Posted by RaceJunkie (Post 1320284)
When I do a search for new posts and the results are returned,(Don't know the actual template) I click on the + and it shows the first post instead of last. In FORUMDISPLAY when I click the + the last post is showed like it should be. I have it set to show Last post. Has this been a problem for anyone else?

Thanks for this great mod.

Read through this thread. You'll find the information you're looking for.

Coldhands 08-20-2007 04:29 PM

Quote:

Originally Posted by Tralala (Post 1239918)
Okay, well, now I no longer get the error... the UserCP page loads fine... which is obviously a step in the right direction. :up:

But, unfortunately, I'm back where we started in that the expand/collapse button that appears in the title of the subscribed threads doesn't actually do anything. Clicking on it has no effect. It still works fine in the regular forum view, though.


I do also see the same thing that was mentioned earlier, with regards to spoilers and my particular spoiler BB code. When clicking on the expand/collapse button in regular forum view, if the post that is revealed has a spoiler in it, the state of that spoiler is set to "show" instead of "hide." The spoiler button works fine, mind you. It's just that it should default to "hide" the spoilerized text rather than show it... just like it appears in the regular post.

Here is my BB replacement code, if that helps any:

PHP Code:

<div style="margin:5px 20px 20px 20px">
  <
div class="smallfont" style="margin-bottom:2px">
   <
input type="button" value="Show" style="width:50px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.value=='Show') {this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.value='Hide';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display='none'; this.value='Show';}">
  </
div>
  <
div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
    <
div style="display: none;">{param}</div>
  </
div>
</
div

FWIW, I am running vBulletin 3.6.4 on this particular forum.

Quote:

Originally Posted by magnus (Post 1239931)
Would it be possible for you to make me a temporary account on your forum and PM me the details? I'd like to check this out first hand if possible.

Any word on the spoiler fix? I'm having the same problem, and I don't want to use the hack until I've found a work around to the spoiler bug. A lot of my board's first posts contain spoilers due to punchlines and large amounts of text (and the occasional nsfw pic:erm:). Has anyone fixed / found a different spoiler hack that plays nice?

TIA,

C

JadedSouls 08-22-2007 12:32 AM

I love this mod! Thank you so much...

Installed it right away..

morpheusXIIX 08-31-2007 11:49 AM

I just updated this hack, now the +/- box shows on a black line above the thread title instead of on the same line. Any idea how to revert this?

yoyoyoyo 09-12-2007 08:59 PM

thanks much!

Mr.Danko Jones 09-21-2007 05:18 AM

Cool mod but it doesn't seem to be expanding on my board. See my .sig. Please let me know what I am doing wrong.:)


All times are GMT. The time now is 01:53 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.01732 seconds
  • Memory Usage 1,885KB
  • 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
  • (1)bbcode_code_printable
  • (5)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete