phpbb-auction.com Forum Index phpbb-auction.com
Download, Support, Documentation
 
Donate to phpbb-auction.com to support the project


phpbb-Auction
  Home
   - News
   - Bug report/Patches
   - Future Features
  Demo
  Downloads
   - Version 1.3m  (Core /Lang /Mods)
   - Version 1.2m  (Core /Lang /Mods)
   - Version 1.0m  (Core /Lang /Mods)
   - All
  Services
  Documentation
   - Features
   - Documents
   - How-Tos
   - About
  Support
   - English
   - German
  Development
   - Changlog
   - Requests
   - Team
   - CVS
  Community
   - Website of the Month
   - Websites
   - Community Forum
   - Member

Navigation
FAQFAQ
SearchSearch
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesLog in to check your private messages
Log inLog in

Forum
Changing start time auctions
Sun Feb 07, 2010 4:33 am FR
Easy: what code to use to update sql table?
Fri Oct 16, 2009 8:39 am guyb
Unlimited products(downloads)
Wed Oct 14, 2009 7:09 pm hoimyr
Seller chooses currency
Sun Oct 11, 2009 8:00 pm hoimyr
Cant select end date without getting error
Sun Oct 11, 2009 6:43 pm hoimyr

About
Author: FR
Credits:
Brookfresh, Brad Lawryk, Crogon, DaMysterious, EklipzeDesigns, ML, musashi, phpBB Group, phpBB-Auction-Team, php-styles, sanman, Tel, Vampy, wGEric

Supported Sites





Statistics
User: 18058
Posts: 18401
Latest User: BardykGyday

Add pages with acp control

 
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Feature Request
View previous topic :: View next topic  

Create new pages on the fly from ACP?
Wow! super cool like velcro but without the fuzzy stuff
100%
 100%  [ 4 ]
No way! all your ideas stink!
0%
 0%  [ 0 ]
Total Votes : 4

Author Message
treebeard
Large-Cap Auctioneer
Large-Cap Auctioneer


Joined: 14 Sep 2004
Posts: 140
Location: Central Command

PostPosted: Mon Jan 10, 2005 12:50 am    Post subject: Add pages with acp control Reply with quote

I have been trying to use the "blank template mod" with some success. However, I am having issues getting it to blend in with the auction side of things.

FR, maybe you could implement this! Very Happy

This is what I would like it to do:

Create new pages from the ACP
Must be Mod rewrite compliant
Must remove session ID's for guests to maintain google compliance
Need to include selected blocks like: news, my auction, search, auction room list etc.

Here is the code for the 'Blank Template Mod' as is:

Install instructions:

Code:
##############################################################
## MOD Title: Blank Template MOD
## MOD Author: Poupoune <poupoune> (N/A) http://php-tools.org/poupoune/
## MOD Author, Secondary: psychowolfman <admin> (Brent Upton) N/A
## MOD Description: An easy way to add a blank page to your forum
## MOD Version: 2.0.0
##
## Installation Level: (Easy)
## Installation Time: 5 Minutes
## Files To Edit:   7
##   includes/page_header.php
##   viewonline.php
##   admin/index.php
##   language/lang_english/lang_main.php
##   language/lang_english/lang_admin.php
##   includes/constants.php
##   templates/subSilver/overall_header.tpl
##
## Included Files:   5
##   templates/subSilver/template.tpl
##   templates/subSilver/admin/admin_add_pages.tpl
##   templates/subSilver/admin/admin_edit_add_pages.tpl
##   admin/admin_add_pages.php
##   template.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##  With this MOD you can easily add blank pages to your board.
##  These pages:
##    - are totally integrated into phpBB
##    - are fully administrable by the ACP
##    - are using session management ( user register, viewonline )
##    - are under phpBB authorization system
##    - are linked on the overall_header into a jumpbox (alternative nav menu may be developped)
##############################################################
## MOD History:
##
##   2004-08-08 - Version 2.0.0  MOD Totally rewritten
##   2003-10-06 - Version 1.0.0  MOD Submitted and denied based on improper syntax
##   2003-10-09 - Version 1.0.1  Syntax corrected
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------
#

copy template.php to template.php
copy admin/admin_add_pages.php to admin/admin_add_pages.php
copy templates/subSilver/admin/admin_add_pages.tpl to templates/subSilver/admin/admin_add_pages.tpl
copy templates/subSilver/adminadmin_edit_add_pages.tpl to templates/subSilver/admin/admin_edit_add_pages.tpl
copy templates/subSilver/template.tpl to templates/subSilver/template.tpl

#
#-----[ SQL ]------------------------------------------
#

CREATE TABLE phpbb_add_pages (
page_id MEDIUMINT(8) NOT NULL,
page_name VARCHAR(100) NOT NULL,
page_content TEXT,
page_auth TINYINT(1) NOT NULL
);

#
#-----[ 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><option>'. $lang['Added_pages'] .'</option><option>-------------------</option>';

while( $row = $db->sql_fetchrow($result) )
{
  $page_template .= '<option>'. $row['page_name'] .'</option>';

$page_template .= '</select>';
// END Blank Template MOD

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

  'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span>', '</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>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>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>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');


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------
#
</span></td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#
   <form>
        <tr align="center"><td><span class="mainmenu">{PAGE_TEMPLATE} <input></span></td></tr>
        </form>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Template.php for 'root':

Code:
<?php

/***************************************************************************
 *                     template.php [ Blank Template MOD ]
 *                            -------------------
 *   D??but                : 08-08-2004
 *   Auteur               : Poupoune <poupoune>
 *   Contact              : http://php-tools.org/poupoune/
 *
 ***************************************************************************/

// standard hack prevent
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

// standard session management
$page_template = - (intval($HTTP_GET_VARS['page']) + PAGE_TEMPLATE);
$userdata = session_pagestart($user_ip, $page_template);
init_userprefs($userdata);

// On r??cup??re les donn??es
if( $HTTP_GET_VARS['page'] )
{
  $sql = "SELECT * FROM ". ADD_PAGES_TABLE ."
    WHERE page_id = ". intval($HTTP_GET_VARS['page']);
  if( !$result = $db->sql_query($sql) )
   {
     message_die(GENERAL_ERROR, "Couldn't delete forum information!", "", __LINE__, __FILE__, $sql);
   }
  if( $row = $db->sql_fetchrow($result) )
  {
    if( $userdata['session_logged_in'] )
    {
      if( ( $userdata['user_level'] == ADMIN ) || ( $userdata['user_level'] >= $row['page_auth'] ) )
      {
        // set page title
        $page_title = $row['page_name'];
        $page_content = $row['page_content'];
      }
      else
      {
        $message = sprintf($lang['Not_auth'], $lang['Moderators']);
        message_die(GENERAL_MESSAGE, $message);
      }
    } 
    else
    {
      if( $row['user_auth'] != ANONYMOUS )
      {
        $message = sprintf($lang['Not_auth'], $lang['Users']);
        message_die(GENERAL_MESSAGE, $message);
      }
    }
  } 
  else
  {
    $page_content = '';
    message_die(GENERAL_MESSAGE, $lang['No_page_exists']);
  }
}
else
{
  $page_content = '';
  message_die(GENERAL_MESSAGE, $lang['No_page_exists']);
}


// standard page header
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

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

$template->assign_vars( array(
    'PAGE_TITLE' => $page_title,
    'PAGE_CONTENT' => $page_content
  ));

$template->pparse('body');

// standard page footer
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>


Template.tpl for /templates/subsilver/:

Code:
{PAGE_CONTENT}



/template/subsilver/admin/admin_add_pages.tpl

Code:

<h1>{L_TITLE}</h1>

<p>{L_EXPLAIN}</p>

<form>
<table width="99%" cellpadding="4" cellspacing="1" border="0" align="center" class="forumline">
   <tr>
      <th>{L_ADD_PAGES_TITLE}</th>
   </tr>
  <tr>
    <td class="catLeft" width="50%" align="center"><span class="cattitle">{L_ADD_PAGES_NAME}</span></td>
    <td class="catRight" width="50%" align="center" colspan="2"><span class="cattitle">{L_MANAGE}</span></td>
  </tr>
   <BEGIN>
  <tr>
      <td class="row1" width="50%"><span class="gen"><a href="{pages.U_PAGE_NAME}" target="_new">{pages.PAGE_NAME}</a></span></td>
    <td class="row2" width="25%" align="center">{pages.U_EDIT}</td>
    <td class="row2" width="25%" align="center">{pages.U_DELETE}</td>
   </tr>
   <END>
  <tr>
      <td colspan="3" class="row2"><input> <input></td>
   </tr>
</table>
</form>


/templates/subsilver/admin_edit_add_pages.tpl

Code:

<h1>{L_TITLE}</h1>

<p>{L_EXPLAIN}</p>

<form>
<table width="99%" cellpadding="4" cellspacing="1" border="0" align="center" class="forumline">
   <tr>
      <th>{L_EDIT_PAGE}</th>
   </tr>
  <tr>
      <td class="row1">{L_PAGE_NAME}</td>
    <td class="row2"><input></td>
   </tr>
  <tr>
      <td class="row1">{L_PAGE_CONTENT}<span class="gensmall">{L_PAGE_CONTENT_EXPLAIN}</span></td>
    <td class="row2"><textarea>{PAGE_CONTENT}</textarea></td>
   </tr>
  <tr>
      <td class="row1">{L_PAGE_AUTH}<span class="gensmall">{L_PAGE_AUTH_EXPLAIN}</span></td>
    <td class="row2">{PAGE_AUTH}</td>
   </tr>
  <tr>
      <td class="catBottom" colspan="2" align="center">{S_HIDDEN_FIELDS}<input>&nbsp;&nbsp;<input>
      </td>
   </tr>
</table>
</form>


/admin/admin_add_pages.php

Code:
<?php

/***************************************************************************
 *                     admin_add_pages.php [ Blank Template MOD ]
 *                            -------------------
 *   D??but                : 08-08-2004
 *   Auteur               : Poupoune <poupoune>
 *   Contact              : http://php-tools.org/poupoune/
 *
 ***************************************************************************/

define('IN_PHPBB', true);

if( !empty($setmodules) )
{
  $file = basename(__FILE__);
  $module['add_pages']['Configuration'] = "$file";
  return;
}

//
// Let's set the root dir for phpBB
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

$mode = 'add';
if( (isset( $HTTP_POST_VARS['add_page_submit']) ) || ( $HTTP_GET_VARS['mode'] == 'edit' ) || ( $HTTP_GET_VARS['mode'] == 'delete' ) )
{
  // Ajout d'une page
  if( isset( $HTTP_POST_VARS['add_page_submit']) )
  {
     // Permissions
    $auth_toggle = '<select>';
    for( $i = ANONYMOUS ; $i </option>set_filenames(array(
       "body" => "admin/admin_edit_add_pages.tpl")
    );

    $template->assign_vars( array(
      'L_TITLE' => $lang['Add_page'],
      'L_EXPLAIN' => $lang['add_pages_explain'],
      'L_EDIT_PAGE' => $lang['Configuration'],
      'L_PAGE_NAME' => $lang['Page_name'],
      'PAGE_NAME' => $HTTP_POST_VARS['add_page'],     
      'L_PAGE_CONTENT' => $lang['Page_content'],
      'L_PAGE_CONTENT_EXPLAIN' => $lang['Page_content_explain'],
      //'PAGE_CONTENT' => $row['page_content'],
      'L_PAGE_AUTH' => $lang['Page_auth'],
      'L_PAGE_AUTH_EXPLAIN' => $lang['Page_auth_explain'],
      'PAGE_AUTH' => $auth_toggle,
      "L_SUBMIT" => $lang['Submit'],
       "L_RESET" => $lang['Reset']
    ));
  }

  // Edition d'une page
  if( $HTTP_GET_VARS['mode'] == 'edit' )
  {
    $sql = "SELECT * FROM ". ADD_PAGES_TABLE ."
      WHERE page_id = ". intval($HTTP_GET_VARS['id']);
    if ( !($result = $db->sql_query($sql)) )
    {
      message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
    }

    while( $row = $db->sql_fetchrow($result) )
    {
      // Permissions
      $auth_toggle = '<select>';
      for( $i = ANONYMOUS ; $i </option>set_filenames(array(
         "body" => "admin/admin_edit_add_pages.tpl")
      );

      $template->assign_vars( array(
        'PAGE_NAME' => $row['page_name'],
        'L_TITLE' => $row['page_name'],
        'L_EXPLAIN' => $lang['edit_add_pages_explain'],
        'L_EDIT_PAGE' => $lang['edit_page'],
        'L_PAGE_NAME' => $lang['Page_name'],
        'L_PAGE_CONTENT' => $lang['Page_content'],
        'L_PAGE_CONTENT_EXPLAIN' => $lang['Page_content_explain'],
        'PAGE_CONTENT' => $row['page_content'],
        'L_PAGE_AUTH' => $lang['Page_auth'],
        'L_PAGE_AUTH_EXPLAIN' => $lang['Page_auth_explain'],
        'PAGE_AUTH' => $auth_toggle,
        "L_SUBMIT" => $lang['Submit'],
         "L_RESET" => $lang['Reset']
      ));
    }
  }
  if( $HTTP_GET_VARS['mode'] == 'delete' )
  { 
    $sql = "DELETE FROM ". ADD_PAGES_TABLE ."
      WHERE page_id = ". intval($HTTP_GET_VARS['id']);
    if ( !($result = $db->sql_query($sql)) )
    {
      message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
    }
   
    $message = $lang['Deleted'] . "" . sprintf($lang['Click_return_adminaddpages'], "<a href="">", "</a>") . "" . sprintf($lang['Click_return_admin_index'], "<a href="">", "</a>");
   
  message_die(GENERAL_MESSAGE, $message);
  }


// On r??cup??re les donn??es de la base
else{
  $sql = "SELECT * FROM ". ADD_PAGES_TABLE ." ORDER BY page_name ASC";
  if ( !($result = $db->sql_query($sql)) )
  {
    message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
  }

  while( $row = $db->sql_fetchrow($result) )
  {
    $template->assign_block_vars('pages',array(
      'U_PAGE_NAME' => append_sid($phpbb_root_path. "template.$phpEx?page=". intval($row['page_id'])),
      'PAGE_NAME' => stripslashes($row['page_name']),
      'U_EDIT' => "<a href=". append_sid(" id=". intval($row['page_id'])) .">". $lang['Edit'] ."</a>",
      'U_DELETE' => "<a href=". append_sid(" id=". intval($row['page_id'])) .">". $lang['Delete'] ."</a>"

    ));
  }

  $template->set_filenames(array(
     "body" => "admin/admin_add_pages.tpl")
  );


  $template->assign_vars( array(
    'L_TITLE' => $lang['add_pages'],
    'L_EXPLAIN' => $lang['add_pages_explain'],
    'L_ADD_PAGES_TITLE' => $lang['added_pages'],
    'L_ADD_PAGES_NAME' => $lang['add_pages_name'],
    'L_MANAGE' => $lang['Manage'],
    'L_ADD_PAGE' => $lang['Add_page']
  ));
}

if( isset($HTTP_POST_VARS['submit']) )
{
  if( $HTTP_POST_VARS['page_name'] == '')
  {
    $message = $lang['No_name'] . '';
   
    message_die(GENERAL_MESSAGE, $message);
  }
  switch( $mode )
  {
    case 'add' : $sql_max = "SELECT MAX(page_id) AS max_id
            FROM " . ADD_PAGES_TABLE;
         if( !$result_max = $db->sql_query($sql_max) )
         {
            message_die(GENERAL_ERROR, "Couldn't get order number from forums table", "", __LINE__, __FILE__, $sql);
         }
         $row_max = $db->sql_fetchrow($result_max);

         $max_id = $row_max['max_id'];
         $next_id = $max_id + 1;
     
      $sql2 = "INSERT INTO ". ADD_PAGES_TABLE ."
        VALUES( $next_id, '". trim(addslashes($HTTP_POST_VARS['page_name'])) ."', '". $HTTP_POST_VARS['page_content'] ."', ". intval($HTTP_POST_VARS['page_auth']) .")";

      $mess = $lang['Added'];
      break;
    case 'edit' : $sql2 = "UPDATE ". ADD_PAGES_TABLE ."
        SET page_name = '". trim(addslashes($HTTP_POST_VARS['page_name'])) ."', page_content = '". $HTTP_POST_VARS['page_content'] ."', page_auth = ". intval($HTTP_POST_VARS['page_auth']) ."
        WHERE page_id = ". intval($HTTP_GET_VARS['id']);
       
      $mess = $lang['Updated']; 
      break;
  }
     
  if ( !$db->sql_query($sql2) )
  {
    message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql2);
  }   
 
  $message = $mess . "" . sprintf($lang['Click_return_adminaddpages'], "<a href="">", "</a>") . "" . sprintf($lang['Click_return_admin_index'], "<a href="">", "</a>");
   
  message_die(GENERAL_MESSAGE, $message);
}
 


$template->pparse("body");

include('./page_footer_admin.'.$phpEx);

?>


I am using Modrewrite from http://www.able2know.com as included in the SEO MOD

Code:
##############################################################
## MOD Title: phpBB static URLs mod_rewrite 1.0.0
## MOD Author: Craven de Kere (N/A) http://www.Able2Know.com
## MOD Description: This mod should be added AFTER the Able2Know.com SEO mod
## This mod makes static URLs (only for guests) for phpBB, for example topic-22234.html
## Please read the author notes BEFORE using this mod.
## Check http://www.able2know.com/forums/about15132.html
## for the latest version or to get help with this MOD
##
## MOD Version: 1.0.0
##
## Installation Level: (Advanced)
## Installation Time: 5 Minutes
## Files To Edit: page_header.php,
## Included Files: n/a
############################################################## 
## Author Notes:
## Use this mod together with the Able2Know.com SEO Mod (http://www.able2know.com/forums/about15132.html) 
## Make backups and test this on a test forum if you can. This is not a typical mod.
## For an additional tutorial on preventing IP addresses from being logged see:
## http://www.able2know.com/forums/about22586.html
##
##############################################################
## MOD History:
##
##   2004-04-10 - Version 1.0.0
##      - Initial public release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


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

includes/page_header.php

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

//
// Generate logged in/logged out status
//

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

if ( !$userdata['session_logged_in'] )
{
ob_start();
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"'(?<!/)viewforum.php\?f=([0-9]*)&amp;topicdays=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&amp;mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;highlight=*'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&amp;p=([0-9]*)'",
"'(?</viewtopic>sql_query($sql)) )
      {
         message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
      }

      $userdata = $db->sql_fetchrow($result);

      if ( isset($userdata['user_id']) )
      {
         if ( $current_time - $userdata['session_time'] > 60 )
         {
            $sql = "UPDATE " . SESSIONS_TABLE . "
               SET session_time = $current_time, session_start = $current_time, session_page = 0
               WHERE session_id = '" . $userdata['session_id'] . "'";
            if ( !$db->sql_query($sql) )
            {
               message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
            }
         }
         return $userdata;
      }
   }

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Cool
________
og kush marijuana strain


Last edited by treebeard on Fri Feb 04, 2011 6:55 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Crogon
Moderator
Moderator


Joined: 17 May 2004
Posts: 574
Location: Anywhere I'm needed.. which is usually everywhere. ;)

PostPosted: Tue Jan 11, 2005 9:34 am    Post subject: Reply with quote

Slicker than snot, on FR's approval I'll move this to development. Wink

Just a thought.. instead of starting with a blank template, couldn't you pre-populate it with the auction page blocks that are on all the pages?

Does this manipulate the menu listing? If not this could get a bit complicated.
Back to top
View user's profile Send private message
treebeard
Large-Cap Auctioneer
Large-Cap Auctioneer


Joined: 14 Sep 2004
Posts: 140
Location: Central Command

PostPosted: Tue Jan 11, 2005 5:18 pm    Post subject: Reply with quote

Crogon wrote:
Slicker than snot, on FR's approval I'll move this to development. Wink

Just a thought.. instead of starting with a blank template, couldn't you pre-populate it with the auction page blocks that are on all the pages?

Does this manipulate the menu listing? If not this could get a bit complicated.


I would love to have the template pre-populated with the blocks!

Here is an example of a test page for this mod:

http://www.smartsauctions.com/template.php?page=1

notice the link still uses the template.php?page= ...... format would like it to modrewrite to something like tpage1.html

Not sure what you mean by 'manipulate the menu listing' It does have ACP control currently if that is what you mean.

Also, an error I noticed is that I have the page set in the ACP to be viewable by 'ALL' but if you go to the page it requires that you be a registered user. So something is not getting through or maybe I made an error in my installation.

Anyway, I'm glad you approve of this mod however the credit for it should go to Poupoune and psychowolfman I just saw a good use for it for the auction site because with it you could use phpbb and phpbbauction as your whole website and not have to use any silly portal system. I will be getting rid of MX portal in favor of using these blank pages and using the 'hide forum' Mod so that I can use link to forum pages to create additional content without having the linked page show up in the forum. I will post that in another thread.
________
vaporizer


Last edited by treebeard on Fri Feb 04, 2011 6:55 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
treebeard
Large-Cap Auctioneer
Large-Cap Auctioneer


Joined: 14 Sep 2004
Posts: 140
Location: Central Command

PostPosted: Mon Feb 14, 2005 12:51 am    Post subject: Reply with quote

Ok I tinkered with this project for awhile and now have it so that the auction layout will be preserved in the new templates! Give it a test and review the following code changes and give me any ideas you may have for this!

Here is an example page!

http://www.smartsauctions.com/template.php?page=1

Also, the issue with the permissions has been hacked so that the pages created will be viewable by all!

This is my template.php file:

Code:
<?php

/***************************************************************************
 *                     template.php [ Blank Template MOD ]
 *                            -------------------
 *   D??but                : 08-08-2004
 *   Auteur               : Poupoune <poupoune>
 *   Contact              : http://php-tools.org/poupoune/
 *
 ***************************************************************************/

// standard hack prevent
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'auction/auction_common.php');

// standard session management
$page_template = - (intval($HTTP_GET_VARS['page']) + PAGE_TEMPLATE);
$userdata = session_pagestart($user_ip, $page_template);
init_userprefs($userdata);

// Check auction_permission
     checkPermission('VIEW_ALL');
     checkPermission('VIEW_OFFER');
     
       //   Information for the standard Who-is-Online-Block
     $total_posts     = get_db_stat('postcount');
     $total_users     = get_db_stat('usercount');
     $newest_userdata = get_db_stat('newestuser');
     $newest_user     = $newest_userdata['username'];
     $newest_uid      = $newest_userdata['user_id'];

     if( $total_posts == 0 )
          {
               $l_total_post_s = $lang['Posted_articles_zero_total'];
          }
     else if( $total_posts == 1 )
          {
               $l_total_post_s = $lang['Posted_article_total'];
          }
     else
          {
               $l_total_post_s = $lang['Posted_articles_total'];
          }

     if( $total_users == 0 )
          {
               $l_total_user_s = $lang['Registered_users_zero_total'];
          }
     else if( $total_users == 1 )
          {
               $l_total_user_s = $lang['Registered_user_total'];
          }
     else
          {
               $l_total_user_s = $lang['Registered_users_total'];
          }
     // End information for standard Who-is-online-Block

     // Include-Blocks
     includeTickerBlock();
     includeAuctionRoomBlock();
     includeCloseToEndBlock();
     includeStatisticBlock();
     includeMyAuctionsBlock($userdata);
//     includeCalendarBlock();
//     includeSearchBlock();
     includeTermsBlock();
//     includeNewsBlock();
//     includeAuctionSpecialBlock();
     includeAuctionDropDownRoomBlock();

     
// end of auction adds       


// On r??cup??re les donn??es
if( $HTTP_GET_VARS['page'] )
{
  $sql = "SELECT * FROM ". ADD_PAGES_TABLE ."
    WHERE page_id = ". intval($HTTP_GET_VARS['page']);
  if( !$result = $db->sql_query($sql) )
   {
     message_die(GENERAL_ERROR, "Couldn't delete forum information!", "", __LINE__, __FILE__, $sql);
   }
  if( $row = $db->sql_fetchrow($result) )
  {
    if( $userdata['session_logged_in'] )
    {
      if( ( $userdata['user_level'] == ADMIN ) || ( $userdata['user_level'] >= $row['page_auth'] ) )
      {
        // set page title
        $page_title = $row['page_name'];
        $page_content = $row['page_content'];
      }
      else
      {
        // set page title
        $page_title = $row['page_name'];
        $page_content = $row['page_content'];

      }
    }
    else
    {
      if( $row['user_auth'] != ANONYMOUS )
      {
        // set page title
        $page_title = $row['page_name'];
        $page_content = $row['page_content'];
     

      }
    }
  }
  else
  {
    $page_content = '';
    message_die(GENERAL_MESSAGE, $lang['No_page_exists']);
  }
}
else
{
  $page_content = '';
  message_die(GENERAL_MESSAGE, $lang['No_page_exists']);
}


// standard page header
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
include($phpbb_root_path . 'auction/auction_header.'.$phpEx);

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

$template->assign_vars( array(
    'PAGE_TITLE' => $page_title,
    'PAGE_CONTENT' => $page_content));

$template->pparse('body');

// standard page footer
include($phpbb_root_path . 'auction/auction_footer.'.$phpEx);
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>



This is my template.tpl file:

Code:

             
             
              <table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
                <tr>
                  <td align="left"><span class="gensmall">{PAGE_CONTENT}</span></td>
                </tr>
              </table>

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr>
   <td class="catHead" colspan="2" height="28"><span class="cattitle"><!-- <a href="{U_VIEWONLINE}" class="cattitle"> -->{L_WHO_IS_ONLINE}</a></span></td>
  </tr>
  <tr>
   <td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}"></td>
   <td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}{TOTAL_USERS}<NEWEST_USER></span>
   </td>
  </tr>
  <tr>
   <td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE}<nbsp> {RECORD_USERS}<LOGGED_IN_USER_LIST></span></td>
  </tr>
</table>

<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
   <td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table>

<!--
              <BEGIN>
              <form>
                <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
                  <tr>
                    <td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></td>
                  </tr>
                  <tr>
                    <td class="row1" align="center" valign="middle" height="28"><span class="gensmall">{L_USERNAME}:
                      <input>
                      &nbsp;&nbsp;&nbsp;{L_PASSWORD}:
                      <input>
                      &nbsp;&nbsp; &nbsp;&nbsp;{L_AUTO_LOGIN}
                      <input>
                      &nbsp;&nbsp;&nbsp;
                      <input>
                      </span> </td>
                  </tr>
                </table>
              </form>
              <END>
-->             


Very Happy[/u][/url]
________
Ass tubes


Last edited by treebeard on Wed Mar 16, 2011 11:09 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Crogon
Moderator
Moderator


Joined: 17 May 2004
Posts: 574
Location: Anywhere I'm needed.. which is usually everywhere. ;)

PostPosted: Thu Feb 17, 2005 6:38 pm    Post subject: Reply with quote

FR? Should I move this to development?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Feature Request All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


phpbb-auction.com - Developed by www.digital-media-lab.com
Sponsored by: www.globibo.com - www.learn2go.de - www.talentone.org - www.language-school.in - www.ping-ke.cn