vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Mini Mods - Unknown Location (https://vborg.vbsupport.ru/showthread.php?t=169451)

nfn 02-01-2008 10:00 PM

Unknown Location
 
Description:

This modification will let you define a name for your external files replacing the Unknown Location message, usually in Who's Online & Members Profile pages.

Tested With:
  • vBulletin 3.6.8
  • vBulletin 3.7.0 Beta 4
Changes:
  • [v1.0.2] fix a minor bug and support for multiple queries.
  • [v1.0.1] added a 3rd optional parameter to identify the page with a query string.
  • [v1.0.0] first release.
Installation & Upgrade Instructions:

Upload the product & configure the settings for the product Unknown Location.

Notes:

The location of your files are relative to you web root.
With multiple queries, using the standalone file simultaneously, you must ensure that the standalone file comes first:

/file.php:My File
/file.php?do=hello:My Hello:do=hello
/file.php?do=hello&do=goodbye:My Goodbye:do=goodbye

The change is made in the "online_location_unknown" hook. If your page doesn't call this hook, nothing will be changed. To know wich hooks are called, run your board with debug mode on.

How to Use:

File Name:Page Name:Optional Parameter for Query String

/portal.php:Portal
/forum/misc.php:Misc Page
/forum/misc.php?do=hello:Hello:do=hello (using 3rd parameter for misc.php?do=hello)
/forum/misc.php?do=thanks&do=something:Thanks:do=thanks (using 3rd parameter for misc.php?do=thanks)

Please Mark as Installed!

Jase2 02-02-2008 05:41 PM

Thanks for this.

Regards Jason :)

Brian30fl 02-02-2008 05:52 PM

nice mod clicks install

Glenshadow 02-02-2008 05:56 PM

Perfect THANKS !

xixxon 02-02-2008 06:07 PM

cool...installed

Magnumutz 02-02-2008 08:06 PM

Very nice, i know there were quite some people looking for such a hack.

Good job !

aeturner89 02-02-2008 09:56 PM

Awesome hack. *nominates*

Zaiaku 02-03-2008 12:47 AM

Excellent. I remember seeing this before but this is so much better.

projectego 02-03-2008 07:47 AM

Great idea for a hack! :D

Brent H 02-03-2008 02:55 PM

For some reason this isn't working for me.
Code:

/index.php?page=downloads:Downloads
isn't changing anything.

nfn 02-03-2008 03:47 PM

Brent, that's because I remove all query strings from the file. I can define an option for this.

Allan 02-03-2008 03:53 PM

Very nice, great :)

MrNase 02-03-2008 05:37 PM

Please add a setting for that query strings. Thanks! :)

Maybe two textareas, one where the query string is removed and one where the query string remains.

nfn 02-03-2008 09:44 PM

Hi,

Added a 3rd optional parameter where we can define a query string:
/index.php?page=downloads will be set as -> /index.php:Downloads:page=downloads

@Brent: I hope this solve your problem!

Hornstar 02-04-2008 08:28 AM

Thanks, I think inferno has done this with his external modification, but this will be useful if I dont end up getting that. thanks.

testebr 02-06-2008 06:28 PM

I have this:

domai.com/irc_stats/index.php (custom vbulletin page the code bellow);

PHP Code:

<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT''irc_stats');

// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
//$phrasegroups = array('threadmanage', 'posting', 'postbit');

// get special data templates from the datastore
$specialtemplates = array(
);

// pre-cache templates used by all actions
$globaltemplates = array(
        
'irc_stats',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ########################## REQUIRE BACK-END ############################
//require_once('./global.php'); // only if custom page is in default board folder

define('patch_crazy', (($getcwd getcwd()) ? $getcwd '.'));

chdir("/home/myuser/mydomain.com/forum");
require_once(
'./global.php');
chdir(patch_crazy);

...
.....
........

And in plugin I use this:

Code:

irc_stats/index.php:IRC STATS
But, still showing 'main board page'. How to fix it?

I have other page mydomain.com/forum/map.php

and in plugin:

Code:

/forum/map.php:The Map page
Work fine.

nfn 02-06-2008 10:16 PM

Hi,

Try /irc_stats/index.php:IRC STATS.
If that doesn't work, what is the path that you see in your Members Profile:

https://vborg.vbsupport.ru/attachmen...8&d=1201980529

testebr 02-08-2008 03:37 AM

Entrys:

Quote:

/irc_stats/index.php:IRC STATS
irc_stats/index.php:IRC STATS
Result:

Quote:

Viewing Index my_board_title_here
The title with link to board index (/forum/index.php).

My board: domain.com/forum/index.php
My irc_stats: domain.com/irc_stats/index.php

nfn 02-08-2008 07:34 AM

Hi,

If domain.com/forum/index.php is you default index for you board, the title will not be changed.
Where can I get the stats mod you are using to test myself?

jerrygad 02-08-2008 08:40 AM

This is what i am looking for. Thank you for sharing.

testebr 02-08-2008 05:27 PM

Quote:

Originally Posted by nfn (Post 1438739)
Hi,

If domain.com/forum/index.php is you default index for you board, the title will not be changed.
Where can I get the stats mod you are using to test myself?

No stats mod, this is a custom page made by me. But you can test with this example:

/irc_stats/index.php

PHP Code:

<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT''irc_stats');

// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);

// get special data templates from the datastore
$specialtemplates = array(
);

// pre-cache templates used by all actions
$globaltemplates = array(
        
'irc_stats',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ########################## REQUIRE BACK-END ############################
//require_once('./global.php'); // only if use in same board folder

define('patch_crazy', (($getcwd getcwd()) ? $getcwd '.'));

chdir("/home/change/to/your/board/patch");
require_once(
'./global.php');
chdir(patch_crazy);

global 
$vbulletin;

// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude str_replace('clientscript'$vbulletin->options['bburl'] . '/clientscript'$headinclude);

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################

$irc_stats 'just one test to unkown location mod';

$navbits = array(); 
$navbits[$parent] = 'IRC STATS';
$navbits construct_navbits($navbits);

eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('irc_stats') . '");');

?>

*Edit your board patch in code.

template 'irc_stats'

HTML Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>IRC Stats - $vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar

$irc_stats

$footer

</body>
</html>


nfn 02-09-2008 11:31 AM

Hi,

I've tested your page and the problem is since (somehow) it gets the default board name, and this mod is executed inside the online_location_unknown, this hook is never called.

This is not a problem of this modification. The problem might be with the path's of your file:

Code:

define('patch_crazy', (($getcwd = getcwd()) ? $getcwd : '.'));

chdir("/home/myname/public_html/testvb");
require_once('./global.php');
chdir(patch_crazy);

I've tested you file in the same directory as the default vB pages removing all above stuff and just using:

Code:

require_once('./global.php');

and it works!

i have two external files similar to your's in the same place as vB files and these are working.

testebr 02-13-2008 05:37 AM

Yeah, I know, but I need to place this file in main domain.

If not is possible, ok no problem.

Thank you, very useful mod.

nfn 02-13-2008 08:46 AM

@testebr: You're Welcome!

testebr 02-13-2008 11:08 AM

Hello again nfn,

My problem was solved :)

The solution is simple.

First I created this new plugin at hook online_location_preprocess:

PHP Code:

if ($loc == '/irc_stats/')
{
    
$filename 'irc_stats.php';


Now, the hook online_location_unknown will be called with success because the $filename irc_stats.php is not in default list of filenames like you can see in file includes/functions_online.php.

And in options of your plugin I used this entry:

Code:

/irc_stats/:title
Maybe you can add some solution in your plugin like my idea.

Bye

Boofo 02-22-2008 06:08 AM

When I use this:

/forums/info.php:Site Map:do=sitemap

It shows the link like it should but when you click on the link, it only clicks to /forums/info.php without the do=sitemap.

Veer 02-23-2008 07:59 PM

/index.php?act=Arcade&do=newscore:Saving New Score

doesn't work.

Boofo 02-24-2008 01:26 AM

Quote:

Originally Posted by Pehchaan (Post 1449509)
/index.php?act=Arcade&do=newscore:Saving New Score

doesn't work.

Hopefully, we'll get an answer soon to this.

Boofo 02-24-2008 02:56 PM

Quote:

Originally Posted by Pehchaan (Post 1449509)
/index.php?act=Arcade&do=newscore:Saving New Score

doesn't work.

Ok, I fixed this now so it will work with the second variable (example: info.php?do=sitemap).

In the XML file:

Find:

Code:

$userinfo['action'] = $vbphrase[ul_viewing]. ' <a href="' .$ul_file[0]. '" title="' .$ul_file[1]. '">' .$ul_file[1]. '</a>';
REPLACE it with:

Code:

$userinfo['action'] = $vbphrase[ul_viewing]. ' <a href="' .$ul_file[0].'?'.$ul_file[2]. '" title="' .$ul_file[1]. '">' .$ul_file[1]. '</a>';
The fix was there, he just forgot to add it variable to the link line.

nfn 02-26-2008 08:29 PM

Hi,

The fix you provide will do it ONLY if you have one query.
I just updated the modification with a minor fix and support for multiple queries.

Note that now you will need to place the full page (file & query) in the first parameter as explained in the first post.

Boofo 02-26-2008 08:39 PM

You're welcome.

Boofo 02-26-2008 11:44 PM

You need to add the code I gave you back in the link. The link is only showing the file name and not the do=anything.

Hostboard 02-29-2008 05:09 PM

Got this working for all but 1 link:

Tried:
../photos/showphoto.php/:Gallery

But still shows as unknownm location.

Boofo 02-29-2008 05:11 PM

add your forums directory to tha beginning of it:

/forums/photos/showphoto.php:Gallery

Hostboard 02-29-2008 06:48 PM

Why would I add forums to the front when the photos directory is in the root folder (mouse over provided link)?

I got this to work for PhotPost that also resides in the root folder but that uses a query string.

Boofo 02-29-2008 06:52 PM

Well, you didn't say it wasn't in the forums directory, now, did you?

Try adding a slash as the end of the link.

nfn 02-29-2008 07:32 PM

Hi,

In the Who's Online what is the path for Unknown Location?

Hostboard 02-29-2008 08:40 PM

Nope this did not work either...

../photos/showphoto.php/:Gallery

Boofo 02-29-2008 08:42 PM

Did you try:

/photos/showphoto.php:Gallery

or

./photos/showphoto.php:Gallery

Hostboard 02-29-2008 09:32 PM

Just went back and tried those iterations and nope.

This works:
../photos/showgallery.php?:Gallery
../classifieds/contact.php?:Classifieds
../links/showlink.php?:Links
../links/browselinks.php?:Links

This wont:
../classifieds/showproduct.php:Classifieds
../photos/showphoto.php:Gallery

./classifieds/showproduct.php:Classifieds
./photos/showphoto.php:Gallery

/classifieds/showproduct.php:Classifieds
/photos/showphoto.php:Gallery


The difference is the ones that do not work are URLs (as shown on WOL)

/classifieds/showproduct.php/product/3/cat/all
/photos/showphoto.php/photo/69/cat/500/ppuser/2

Hope this helps.


All times are GMT. The time now is 05:52 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.01437 seconds
  • Memory Usage 1,846KB
  • 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
  • (9)bbcode_code_printable
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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