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)
-   -   Add Who's Online Locations From Admin CP (https://vborg.vbsupport.ru/showthread.php?t=66569)

teksigns 06-27-2004 04:08 AM

i found a bug !

example :
forum installed at:

/forum

i have a script thats installed at and uses the forum engine ....

/forum/links/links.php

my script shows up in the whos online fine and is clickable before i add
the new custom discription.

once i add it... it shows up and displays fine .
however the link is not pointing to the correct location

the link tried to take me to : /forum/links.php

not /forum/links/links.php

can you please fix ....

teksigns 06-27-2004 04:16 AM

ok i fixed it myself already !

heres how....


in : functions_online.php


find:

Code:

if ($value['showlink'] == 1)
{
        $userinfo['where'] = "<a href=\"$key?$session[sessionurl]\">$value[where]</a>";
}


replace with:

Code:

if ($value['showlink'] == 1)
{
$url = htmlspecialchars_uni(stripslashes($userinfo['location']));
$url = addslashes($url);
$url = preg_replace('/(s|sessionhash)=[a-z0-9]{32}(&|&amp;){0,1}/', '', $url);
if ($session['sessionurl'] != '')
{
if (strpos($url, '?') !== false)
{
$url .= "&amp;$session[sessionurl]";
}
else
{
$url .= "?$session[sessionurl]";
}}
        $userinfo['location'] = stripslashes(stripslashes($url));
        $userinfo['location'] = ereg_replace('&amp;','&',$userinfo[location]);
        $userinfo['where'] = "<a href=\"$userinfo[location]\">$value[where]</a>";
}


great hack !



Quote:

edited my post ....removed the function file include from the code ....

Acido 06-27-2004 09:31 AM

Quote:

Originally Posted by teksigns
ok i fixed it myself already !

heres how....


in : functions_online.php


find:

Code:

if ($value['showlink'] == 1)
{
        $userinfo['where'] = "<a href=\"$key?$session[sessionurl]\">$value[where]</a>";
}


replace with:

Code:

if ($value['showlink'] == 1)
{
        require_once('./includes/functions_login.php');
        $userinfo['location'] = stripslashes(fetch_replaced_session_url(htmlspecialchars_uni(stripslashes($userinfo['location']))));
        $userinfo['location'] = ereg_replace('&amp;','&',$userinfo[location]);
        $userinfo['where'] = "<a href=\"$userinfo[location]\">$value[where]</a>";
}


great hack !

I cant find the code in functions_online.php :(

Trigunflame 06-27-2004 10:59 AM

Quote:
---------------------------------------------------------
if ($value['showlink'] == 1)
{
require_once('./includes/functions_login.php');
$userinfo['location'] = stripslashes(fetch_replaced_session_url(htmlspecia lchars_uni(stripslashes($useri nfo['location']))));
$userinfo['location'] = ereg_replace('&amp;','&',$userinfo[location]);
$userinfo['where'] = "<a href=\"$userinfo[location]\">$value[where]</a>";
}
---------------------------------------------------------

That is not a bug in the script, all this does is compare filenames which im using vbulletins method. No way would i Include (functions_login.php) a Whole other functions file into the login functions.. a much easier way to do it im sure.

PET 06-27-2004 01:09 PM

exactly what i need ! No need to manualy edit php's :)

teksigns 06-27-2004 01:31 PM

Acido ,

you must have already installed his hack inorder to find the code ......

if you havent installed the hack itself then the code will not be there.

Oblivion Knight 06-27-2004 02:10 PM

Awesome, I'll take a look at this when 3.0.2 is released.. :)
I don't want to do any more modifying when there is another upgrade just around the corner.

teksigns 06-27-2004 02:16 PM

Quote:

Originally Posted by Trigunflame
Quote:
---------------------------------------------------------
if ($value['showlink'] == 1)
{
require_once('./includes/functions_login.php');
$userinfo['location'] = stripslashes(fetch_replaced_session_url(htmlspecia lchars_uni(stripslashes($useri nfo['location']))));
$userinfo['location'] = ereg_replace('&amp;','&',$userinfo[location]);
$userinfo['where'] = "<a href=\"$userinfo[location]\">$value[where]</a>";
}
---------------------------------------------------------

That is not a bug in the script, all this does is compare filenames which im using vbulletins method. No way would i Include (functions_login.php) a Whole other functions file into the login functions.. a much easier way to do it im sure.



ok i altered it so you it dont use the include any longer ......

this is the code im using now and it works just the same without the include .

Code:

if ($value['showlink'] == 1)
{
$url = htmlspecialchars_uni(stripslashes($userinfo['location']));
$url = addslashes($url);
$url = preg_replace('/(s|sessionhash)=[a-z0-9]{32}(&|&amp;){0,1}/', '', $url);
if ($session['sessionurl'] != '')
{
if (strpos($url, '?') !== false)
{
$url .= "&amp;$session[sessionurl]";
}
else
{
$url .= "?$session[sessionurl]";
}}
        $userinfo['location'] = stripslashes(stripslashes($url));
        $userinfo['location'] = ereg_replace('&amp;','&',$userinfo[location]);
        $userinfo['where'] = "<a href=\"$userinfo[location]\">$value[where]</a>";
}


hope this works for everyone else

Bryan Ex 06-27-2004 04:33 PM

Just so I'm clear before installing... will this work for indexing php pages outside the VB main directory? For example, an integrated application like a gallery script.

Trigunflame 06-27-2004 09:06 PM

Quote:

Originally Posted by teksigns
ok i altered it so you it dont use the include any longer ......

this is the code im using now and it works just the same without the include .

Code:

if ($value['showlink'] == 1)
{
$url = htmlspecialchars_uni(stripslashes($userinfo['location']));
$url = addslashes($url);
$url = preg_replace('/(s|sessionhash)=[a-z0-9]{32}(&|&amp;){0,1}/', '', $url);
if ($session['sessionurl'] != '')
{
if (strpos($url, '?') !== false)
{
$url .= "&amp;$session[sessionurl]";
}
else
{
$url .= "?$session[sessionurl]";
}}
        $userinfo['location'] = stripslashes(stripslashes($url));
        $userinfo['location'] = ereg_replace('&amp;','&',$userinfo[location]);
        $userinfo['where'] = "<a href=\"$userinfo[location]\">$value[where]</a>";
}


hope this works for everyone else

Ill post an addition tonight or tomorrow, thats still way to much code to do something so simple.


All times are GMT. The time now is 11:59 PM.

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.01113 seconds
  • Memory Usage 1,752KB
  • 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
  • (6)bbcode_code_printable
  • (4)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
  • (10)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