|
Page 1 of 1
|
lord1
Joined: January 2010
Posts: 49
Location: Earth
|
Page Permisions
First problem is that if i creat a quick link to a page in the cms menu its not shown .
Second is that i created a quick link by editing nav_quck_links.tpl but i want some links to be shown to unregistred users but when they click it i want to require a registration.
|
#1 Mon 01 Nov, 2010 15:16 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
Joshua203
Joshua 203
Dutch A Go Go
Joined: August 2008
Posts: 1754
Location: Earth, Europe, the Netherlands, Rotterdam
|
Re: Page Permisions
Hi Lord1,
Quote: Second is that i created a quick link by editing nav_quck_links.tpl but i want some links to be shown to unregistred users but when they click it i want to require a registration.
It could help if you post the modified part but maybe you added the code between these tags?
<!-- IF S_LOGGED_IN -->
?your modification?
<!-- ENDIF -->
I hope this helped alittle,
...Joshua203
____________ www.DutchaGoGo.com (development/under construction ...Forever?¿?)
|
#2 Mon 01 Nov, 2010 17:02 |
|
lord1
Joined: January 2010
Posts: 49
Location: Earth
|
Re: Page Permisions
if i place those tags only reg users will see the link.
I dont want that ,i want everyone too see it but for unregistred users ,when they click,i want to require registration and then they will be able to see what it contains.
|
#3 Mon 01 Nov, 2010 17:27 |
|
Joshua203
Joshua 203
Dutch A Go Go
Joined: August 2008
Posts: 1754
Location: Earth, Europe, the Netherlands, Rotterdam
|
Re: Page Permisions
if i place those tags only reg users will see the link.
exactly.. this is why i asked if you put it between those tags, because that would explain why they need to login first to see, maybe you can double check where you put your code ?
____________ www.DutchaGoGo.com (development/under construction ...Forever?¿?)
|
#4 Mon 01 Nov, 2010 17:36 |
|
lord1
Joined: January 2010
Posts: 49
Location: Earth
|
Re: Page Permisions
its placed where it should be,please read again my problem.
its already visible for all users but i want to require registration when unregistred users click it so after reg they would be able to see it.
|
#5 Mon 01 Nov, 2010 17:50 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: Page Permisions
so why don´t you include an auth check in your new page ??
so only reg users see the page , but everybody sees the link
so if a user is´nt registrated, he would be automaticly redirected to login.php or
profil.php?mode=register
____________ Out of Order
|
#6 Mon 01 Nov, 2010 18:25 |
|
Joshua203
Joshua 203
Dutch A Go Go
Joined: August 2008
Posts: 1754
Location: Earth, Europe, the Netherlands, Rotterdam
|
Re: Page Permisions
sorry for not understanding immediately (languages hmmm)
how about adding this <!-- IF S_LOGGED_IN --> to the linked page?
Edit: Sorry Spydie ...same time posting , thanks for jumping in
____________ www.DutchaGoGo.com (development/under construction ...Forever?¿?)
|
#7 Mon 01 Nov, 2010 18:27 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: Page Permisions
Oehm.
I supose we´re talking an php file, not an html or tpl.
This IF is´nt the correct thing then.
should be an auth check in an php file.
- if (!$userdata['session_logged_in'])
- {
- redirect(append_sid('login_ip.' . PHP_EXT . '?redirect=yourpage.' . PHP_EXT, true));
- }
-
Im talking something like this
____________ Out of Order
|
#8 Mon 01 Nov, 2010 18:59 |
|
lord1
Joined: January 2010
Posts: 49
Location: Earth
|
Re: Page Permisions
spydie ,thats exactly what i ment but i have a litle prob with redirect function
Link
<?php
/**
*
* @package Icy Phoenix
* @version $Id: album.php 96 2009-04-27 16:48:19Z Mighty Gorgon $
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
*/
/**
*
* @Extra credits for this file
* Smartor (smartor_xp@hotmail.com)
*
*/
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
if (!$userdata['session_logged_in'])
{
redirect(append_sid('login_ip.' . PHP_EXT . '?redirect=files/Chess.swf.' . PHP_EXT, true));
}
page code
|
#9 Mon 01 Nov, 2010 20:15 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: Page Permisions
lets think, that your problem is here
Chess.swf.' . PHP_EXT,
witch translates into Chess.swf.php
put it this way
redirect=files/Chess.swf' , true));
and you might think about including common.php
by the way,
you should think about creating an tpl file, with your swf file and a player included
maybe have a look at this http://www.icyphoenix.com/viewtopic.php?f=4&t=6436
____________ Out of Order
|
#10 Mon 01 Nov, 2010 20:40 |
|
lord1
Joined: January 2010
Posts: 49
Location: Earth
|
Re: Page Permisions
im getting the same error, what about the "simple way"
including auth check , can u show me how it looks easyer for me
|
#11 Tue 02 Nov, 2010 14:07 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: Page Permisions
OK so you want it all done, is taht what you call the easy way??
this in your route
chess.php
<?php
/***************************************************************************
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
* my template.php
* -------------------
* Instructions by Lopalong 8th September 2009 < http://www.lopalong.com >.
*
***************************************************************************/
/***************************************************************************
*
* READ THIS! Wherever you see MY_TEMPLATE or My_Template or my_template, replace with whatever you
* want to call your new page.
*
***************************************************************************/
// CTracker_Ignore: File checked by human
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
/***** If you want to create VARS (Custom) that do not already exist in Icy Phoenix, you can add them to this page, or create the file "variables.php" for variable-transition of your own "Stand-Alone VARS" to the .tpl file(s). So you will need to uncomment the line below.
*****/
// include(IP_ROOT_PATH . 'variables.' . PHP_EXT);
// standard session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// Check if user is logged in
if (!$userdata['session_logged_in'])
{
redirect(append_sid('login_ip.' . PHP_EXT . '?redirect=files/chess.' . PHP_EXT, true));
}
// set the page title
$page_title = 'Chess';
// The standard page header
include(IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT);
// assign the template
$template->set_filenames(array('body' => 'chess.tpl'));
$template->assign_vars(array(
// This is where you would add a new VARS Array and any of your own if you intend to use your OWN custom VARS with a variables.php file.
));
$template->pparse('body');
// standard page footer
include(IP_ROOT_PATH . 'includes/page_tail.' . PHP_EXT);
?>
and this in templates/default/chess.tpl
<table width="100%" border="0">
<tr>
<td><div align="center">
<h1>Chess </h1>
<p>
The Macromedia player code, including path of your swf file
</p>
</div></td>
</table>
only thing you need to edit is the tpl file
____________ Out of Order
|
#12 Tue 02 Nov, 2010 14:52 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Page Permisions
If you don't want to create, or don't need a template etc - Add this to the header menu bar for something quick and easy.
Change paths and language to suit.
With alert:
<!-- IF not S_LOGGED_IN -->
<a href="JavaScript:void(0);" onclick="alert('You must register or log in to be able to play chess?')">Chess</a> <img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />
<!-- ELSE -->
<a href="{FULL_SITE_PATH}chess.swf" target="_blank">Chess</a> <img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />
<!-- ENDIF -->
Or, With alert and re-direct to login_ip.php:
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}login_ip.php" onclick="alert('You must register or log in to be able to play chess?')">Chess</a> <img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />
<!-- ELSE -->
<a href="{FULL_SITE_PATH}chess.swf" target="_blank">Chess</a> <img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />
<!-- ENDIF -->
Or, No alert and re-direct to login_ip.php:
<!-- IF not S_LOGGED_IN -->
<a href="{FULL_SITE_PATH}login_ip.php">Chess</a> <img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />
<!-- ELSE -->
<a href="{FULL_SITE_PATH}chess.swf" target="_blank">Chess</a> <img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />
<!-- ENDIF -->
|
#13 Sat 04 Dec, 2010 00:39 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|