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)

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.


All times are GMT. The time now is 03:23 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.01273 seconds
  • Memory Usage 1,759KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (3)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