PDA

View Full Version : Can someone help me please?


oldfashionedfam
10-08-2008, 02:54 PM
I am using the mod that creates another page within vbulletin, using the header and footer. Seen here: https://vborg.vbsupport.ru/showthread.php?p=791513#post791513

My question, does this work with the current version of vbulletin? And if so, I keep getting the 404 Error Page not found.

I don't understand why I keep getting this. I've created the rules.php in notepad, uploaded via FTP to the site directory, created the new template in admincp, and copied information given in that. But for some reason, every time I go to where the page SHOULD be, I get the 404 Error.

Thanks for any help, it is GREATLY appreciated!

noppid
10-08-2008, 02:58 PM
That should work fine. Post your code.

oldfashionedfam
10-08-2008, 03:10 PM
This is what I put in the .php file I created and uploaded. Now, this is also going into a sub-directory, so maybe I didn't put it in the right one? However, I've tried quite a few of them.

<?php

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

// ##################### DEFINE IMPORTANT CONSTANTS #######################
// change the line below to the actual filename without ".php" extention.
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation.

define('THIS_SCRIPT', 'rules1');

// #################### 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(
// change the lines below to the list of actual templates used in the script
'rules',

);

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

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');

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

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

$navbits = array();
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
$navbits[$parent] = 'OFCF Rules';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// change the line below to contain the name of the actual main output template used in your script
eval('print_output("' . fetch_template('rules') . '");');

?>


And here is the code that I placed in the template that I created in admincp.

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

$header
$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">
<tr>
<td class="tcat">OFCF Rules</td>
</tr>
<tr>
<td class="alt1">Other Bluff...</td>
</tr>
</table>



Thank you for your help! :)

noppid
10-08-2008, 03:12 PM
That will basically put out a blank page so far. Ya need a footer. But cool.

Now, show me your forum path url and the url to where your script lives. Full urls please.

add at the end.

$footer
</body>
</html>

oldfashionedfam
10-08-2008, 03:22 PM
Noppid, sorry about not having the footer, etc. I actually do have that in place in the template, just when I copied it to place here, it didn't grab it. :) So it is currently there.

The url where the page SHOULD show up is http://www.oldfashionedfamilies.com/forums/rules.php

Does that look right? I'm a newbie, just so you know. I've had this site for 2 years, and done things up until this point. :)

Thanks again for helping!

noppid
10-08-2008, 03:24 PM
Ok, so it's in the forums folder. But it's 404. You gotta straighten that out. IF it's there, try setting it to chmod 755.

oldfashionedfam
10-08-2008, 03:26 PM
Ok, I'm a little confused. Where do I try setting it to chmod 755?

noppid
10-08-2008, 03:30 PM
Ok, I'm a little confused. Where do I try setting it to chmod 755?

In FTP right click on the file, assuming when you look in ftp the file rules.php is there in the forums folder, and select file attributes. See what it is and set it to 755.

oldfashionedfam
10-08-2008, 03:34 PM
Ok, just so I'm correct before I do this, when I open up /public_html/forums rules1.php IS there. I right click on the file, go to properties (I use Core FTP Lite) and there is a VALUE there of 644. I change the 644 to 755, correct?

And thanks again.

--------------- Added 1223483813 at 1223483813 ---------------

I'm dumb......I just figured out why it isn't working right now. I named the file rules1.php and am looking for it at rules.php

I wonder why it didn't work before when I had it set at rules.php?

Goodness....:o

--------------- Added 1223483941 at 1223483941 ---------------

Hey, if you wouldn't mind, I have another question.

How would I make a link on the navbar in the forums main called Rules that would take me to this page I created?

noppid
10-08-2008, 03:45 PM
hehe, I saw that 1 and laughed. Yeah, you had the file attributes idea correct. if the file works and 644, leave it alone. If not, reset it.



In NAVBAR: (link in navbar)

Find:

<if condition="$show['registerbutton']">
<td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
</if>

Add BELOW:

<td class="vbmenu_control"><a href="rules.php?$session[sessionurl]">$vbphrase[my_rules_phrase]</a></td>



Or you can load the template hook var in your php code and display it. That will require using a hook.

oldfashionedfam
10-08-2008, 04:20 PM
LOL Thank you! It brings up the page now.

I've added the code that you gave me for the link in the navbar, however, it's not showing up anything......:confused:

noppid
10-08-2008, 04:23 PM
replace $vbphrase[my_rules_phrase] with Rules. :)

Or create a phrase called my_rules_phrase.

oldfashionedfam
10-08-2008, 04:36 PM
Noppid, so here's what I have:

<td class="vbmenu_control"><a href="rules1.php?$session[sessionurl]">$vbphrase[rules]
(without the space here, as the rest won't show up without it)
</a></td>

But 'Rules' is not showing up in the navbar for some reason?

noppid
10-08-2008, 04:43 PM
Does a phrase called rules exist in the global context to display that phrase? If it's a rules context phrase, it may only appear on certain pages.

oldfashionedfam
10-08-2008, 04:46 PM
I think that might have been the problem. I did a search for adding additional links to the navbar and found this: https://vborg.vbsupport.ru/showthread.php?t=118924

And it works perfect!

I cannot thank you enough for helping me with what you did. I was SO frustrated for 3 days now trying to figure out why I couldn't get the stupid page to load. Thank you SOOO very much!!!! :)

noppid
10-08-2008, 05:00 PM
Good deal. Enjoy it.