Jump to content

Recommended Posts

Hello,

 

Can one locate the bit where in the code below it says about permission to view.

Actually its a phpbb mod for blank pages, and I cannot have guests view the page, even tho I allowed em in ACP.

 

# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$template->assign_vars(array(    

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

// BEGIN Blank Template MOD
if( isset( $HTTP_POST_VARS['added_pages_submit'] ) )
{
  redirect(append_sid("template.php?page=". intval( $HTTP_POST_VARS['added_pages']) ));
}

$sql = "SELECT * FROM ". ADD_PAGES_TABLE ." ORDER BY page_name";
if ( !$result = $db->sql_query($sql) )
{
  message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
}
$page_template = '<select name="added_pages"><option>'. $lang['Added_pages'] .'</option><option>-------------------</option>';

while( $row = $db->sql_fetchrow($result) )
{
  $page_template .= '<option value='. $row['page_id'] .'>'. $row['page_name'] .'</option>';
}  
$page_template .= '</select>';
// END Blank Template MOD

# 
#-----[ FIND ]------------------------------------------ 
# 

  'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

  'L_SEE_PAGE' => $lang['See_page'],
  'PAGE_TEMPLATE' => $page_template,

# 
#-----[ OPEN ]------------------------------------------ 
# 
viewonline.php

# 
#-----[ FIND ]------------------------------------------ 
# 

      switch( $row['session_page'] )

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
      
      // BEGIN Blank Template MOD
      if( $row['session_page'] < PAGE_TEMPLATE )
      {
        $page_id = - ($row['session_page'] + PAGE_TEMPLATE);
        $sql_tpl = "SELECT page_name WHERE page_id = $page_id";
        if ( !($result_tpl = $db->sql_query($sql_tpl)) )
        {
      message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql);
        }
        while( $rowtpl = $db->sql_fetchrow($result_tpl) )
        {
          $location = $rowtpl['page_name'];
      $location_url = "template.$phpEx?page=$page_id";
    }    
      }
      // END Blank Template MOD

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/index.php

# 
#-----[ FIND ]------------------------------------------ 
# 

      switch($onlinerow_reg[$i]['user_session_page'])

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
      
          // BEGIN Blank Template MOD
          if( $onlinerow_reg[$i]['user_session_page'] < PAGE_TEMPLATE )
          {
            $page_id = - ($onlinerow_reg[$i]['user_session_page'] + PAGE_TEMPLATE);
            $sql_tpl = "SELECT page_name WHERE page_id = $page_id";
            if ( !($result_tpl = $db->sql_query($sql_tpl)) )
            {
          message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql);
            }
            while( $rowtpl = $db->sql_fetchrow($result_tpl) )
            {
              $location = $rowtpl['page_name'];
          $location_url = "template.$phpEx?page=$page_id";
        }    
          }
          // END Blank Template MOD

# 
#-----[ FIND ]------------------------------------------ 
# 

    switch( $onlinerow_guest[$i]['session_page'] )                        

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
      
      // BEGIN Blank Template MOD
      if( $onlinerow_guest[$i]['session_page'] < PAGE_TEMPLATE )
      {
        $page_id = - ($onlinerow_guest[$i]['session_page'] + PAGE_TEMPLATE);
        $sql_tpl = "SELECT page_name WHERE page_id = $page_id";
        if ( !($result_tpl = $db->sql_query($sql_tpl)) )
        {
      message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql);
        }
        while( $rowtpl = $db->sql_fetchrow($result_tpl) )
        {
          $location = $rowtpl['page_name'];
      $location_url = "template.$phpEx?page=$page_id";
    }    
      }
      // END Blank Template MOD

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

// BEGIN Blank Template MOD
$lang['No_page_exists'] = 'The page you requested does not exist.';
$lang['Not_auth'] = 'Sorry, but only %s can access this page.';
$lang['Users'] = 'Registered users';
$lang['Added_pages'] = ' Added pages ';
$lang['See_page'] = 'See the page';
// END Blank Template MOD

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

// BEGIN Blank Template MOD
$lang['add_pages'] = 'Blank Template Pages Management';
$lang['add_pages_explain'] = 'This feature allows you to add blank template pages to your phpBB';
$lang['added_pages'] = 'Added pages';
$lang['add_pages_name'] = 'Pages Name';
$lang['edit_add_pages_explain'] = 'Here you can edit the pages you created';
$lang['edit_page'] = 'Edit page';
$lang['Page_name'] = 'Page name';
$lang['Page_content'] = 'Page content';
$lang['Page_content_explain'] = 'This is the content of the page that will be shown';
$lang['Page_auth'] = 'Access auth';
$lang['Page_auth_explain'] = 'This will define who can see the page';
$lang['Click_return_adminaddpages'] = 'Click %shere%s to go back to the Blank Template Pages Management';
$lang['Updated'] = 'The page has been successfully updated';
$lang['Added'] = 'The page has been successfully created';
$lang['Deleted'] = 'The page has been successfully deleted';
$lang['Add_page'] = 'Add a page';
// END Blank Template MOD

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/constants.php

# 
#-----[ FIND ]------------------------------------------ 
# 
define('PAGE_GROUPCP', -11);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
define('PAGE_TEMPLATE', -1045);

# 
#-----[ FIND ]------------------------------------------ 
# 
define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
define('ADD_PAGES_TABLE', $table_prefix.'add_pages');

Link to comment
https://forums.phpfreaks.com/topic/46525-help-with-this-phpbb-code/
Share on other sites

The above code is for a Blank Template mod for my forum.

 

I'm using this for the link exchange.

 

I asked on Phpbb the only thing mods do is lock topics

on phpbbhacks(from where I downloaded) no reply.

 

Its not letting guests to view page.

 

does it need a SID which allows un logged in users to view it?

 

thanks

Doesn't it add a setting to the ACP? As just looking briefly at the code it is querying the database for permissions and I see code that sets up settings to allow who can see your blank pages.

 

The code should have permissions built into.

Doesn't it add a setting to the ACP? As just looking briefly at the code it is querying the database for permissions and I see code that sets up settings to allow who can see your blank pages.

 

The code should have permissions built into.

 

Yes it does have an option in ACP.

-All *

-Reg

-Mod

 

But still its not working, Doesn't let the the guests view it. page here.

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.