Blank Page Template

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
72
64%
Very Good
21
19%
Good
10
9%
Fair
2
2%
Poor
8
7%
 
Total votes: 113

rh-penguin
Registered User
Posts: 46
Joined: Sun Nov 12, 2006 12:25 am

Post by rh-penguin »

so can u tell me what to change cuz theres only ONE $template in teh above ^^^^^^^^^ and dont do it.
Liete
Registered User
Posts: 17
Joined: Sat Dec 16, 2006 7:06 pm

Post by Liete »

TO DO: Add a page in ACP to add/edit/remove new pages automatically.


I'm afraid I'm stuck.
I don't know how to go about doing this :?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52171
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

"TO DO" means it is for the author of this Mod to do, not for you to do...

It means it is a potential future enhancement.
Liete
Registered User
Posts: 17
Joined: Sat Dec 16, 2006 7:06 pm

Post by Liete »

Hmm ok,
But how come my page is not showing?
I've followed the things correctly.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52171
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

No showing where? Did you browse to it?
rh-penguin
Registered User
Posts: 46
Joined: Sun Nov 12, 2006 12:25 am

Post by rh-penguin »

Brf is it so hard to spend 3 minutes and edit that post that i posted?

THERE IS ONLY ONE $template and if i leave it how it is i still get the same error!!!!!
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52171
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

Code: Select all

$template->set_filenames(array( 
        'body' => 'whatever.tpl') 
); 

$template->pparse('body'); 
That is two by my count... plus any

Code: Select all

$template->assign_vars();
statements you might have added.
rh-penguin
Registered User
Posts: 46
Joined: Sun Nov 12, 2006 12:25 am

Post by rh-penguin »

in the READ ME it says:

Code: Select all

# edit the following lines in template.php to point to whatever you called templates/subsilver/template.tpl:
# // assign template 
# $template->set_filenames(array( 
#         'body' => 'template.tpl') 
# ); 
for some fuc*** reason i copied that into 'template.php' so i had 2

Code: Select all

# // assign template 
# $template->set_filenames(array( 
#         'body' => 'template.tpl') 
# ); 
As soon as i noticed that and erased it the page appeard.......

Thanks Brf!!!!!

Marry Xmas!!!
mrvegas
Registered User
Posts: 28
Joined: Wed Aug 09, 2006 7:35 pm
Location: Las Vegas
Contact:

Post by mrvegas »

Brf wrote: After the

Code: Select all

$userdata = session_pagestart($user_ip, PAGE_TEMPLATE); 

init_userprefs($userdata); 

Check for your condition....

If you just want the user logged in

Code: Select all

if ($userdata['user_id'] <1) {
    redirect("login.$phpEx")
    }

If you are checking for a specific group:

Code: Select all

$sql = "select * from ". USER_GROUP_TABLE . " where group_id = The_group_number and user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) ) {
	message_die(GENERAL_ERROR, 'Boooooooooooooooooooom', '', __LINE__, __FILE__, $sql);
}
if (!($row = $db->sql_fetchrow($result) )) {
	$message_die(GENERAL_ERROR, 'You are not authorized to access this page', '', __LINE__, __FILE__, $sql);
                }



Hi,
Thanks for this code info.

I have applied group checker to my template.php and I get the following error:

Code: Select all

You are not authorized to access this page

DEBUG MODE

select * from phpbb_user_group where group_id = 3 and user_id = 4

Line : 22
File : template.php
Now this only shows when the user trying to load the page isnt a member of group 3.

If the user is a member of group 3, the page shows with no problem.

The only thing I had to change was removing the $ in front of the second message line. PHPBB didnt like it.

Any help on how to try and get this debug off the screen will help.

thanks
Matthew
mrvegas
Registered User
Posts: 28
Joined: Wed Aug 09, 2006 7:35 pm
Location: Las Vegas
Contact:

Post by mrvegas »

I was also wanting to know how I would go about linking to this template.tpl file in the server root behind the /www/, so that it is not accessable by direct linking, only the script can access it.

thanks
matthew
smsulliva
Registered User
Posts: 50
Joined: Mon Aug 02, 2004 6:15 pm

Post by smsulliva »

Need help. I followed the directions specifically and I don't see the name of the fiile in my menu.
The php files is called: crafts.php
The .tpl file is called crafts_body.tpl

On the left menu I don't see the link. Here is the code

Code: Select all

			<td class="row1" align="left" valign="top"><a href="{U_CRAFTS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_forums.gif" width="12" height="13" border="0" alt="{L_CRAFTS}" hspace="3" />{L_CRAFTS}</a></td>
			</tr>	
And when I click the link I get this error.

Code: Select all

	
Warning: main(): SAFE MODE Restriction in effect. The script whose uid is 524 is not allowed to access ./extension.inc owned by uid 514 in /home/staff13/public_html/forums/crafts.php on line 6

Warning: main(./extension.inc): failed to open stream: Not a directory in /home/staff13/public_html/forums/crafts.php on line 6

Warning: main(): Failed opening './extension.inc' for inclusion (include_path='.:/usr/local/lib/php') in /home/staff13/public_html/forums/crafts.php on line 6

Warning: main(): Unable to access ./common. in /home/staff13/public_html/forums/crafts.php on line 7

Warning: main(./common.): failed to open stream: No such file or directory in /home/staff13/public_html/forums/crafts.php on line 7

Warning: main(): Failed opening './common.' for inclusion (include_path='.:/usr/local/lib/php') in /home/staff13/public_html/forums/crafts.php on line 7

Fatal error: Call to undefined function: session_pagestart() in /home/staff13/public_html/forums/crafts.php on line 10
	
All files have the permissions of 777. Not sure why it isn't able to access it.
User avatar
addaminsane
Registered User
Posts: 35
Joined: Sun Dec 17, 2006 12:43 am
Location: Kansas City Missouri
Contact:

Post by addaminsane »

do you have to put the mod in every single new page you make or is there an easier way?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52171
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

smsulliva wrote: when I click the link I get this error.

Code: Select all

	
Warning: main(): SAFE MODE Restriction in effect. 


That is your host blocking your script. You will probably have to ask them how to fix it.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52171
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

addaminsane wrote: do you have to put the mod in every single new page you make or is there an easier way?


You dont "put the mod".... The new page IS the mod... How could you have a new page, without having a new page?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52171
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

mrvegas wrote: The only thing I had to change was removing the $ in front of the second message line. PHPBB didnt like it.

Any help on how to try and get this debug off the screen will help.


Yeah. The "$" was a typo....

To get rid of the debug mode message, change the message to:

Code: Select all

message_die(GENERAL_ERROR, 'You are not authorized to access this page');
Post Reply

Return to “[2.0.x] MOD Database Releases”