Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 79
7 members and 72 guests
bearmchdressesr, danansceclasqe6, gratoiduat5kmes, hypye4notherape, lnkmastes, ral4yqkeighqtx5, watcy5gerp
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
tattoo fonts
http://www.checkoutmyink.com/category/tattoo-fonts-tattoo

Go Back   Nukemods Forum > PHP-Nuke 6.5 to 6.9 > Nuke 6.5 to 6.9 - Modules

Reply
 
LinkBack Thread Tools Display Modes
CafePres mod, need help.
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 15
Join Date: May 2003
CafePres mod, need help. - 07-09-2003, 10:27 AM

I am trying to install a CafePres Mod and I get the following error:

Fatal error: Call to undefined function: session_pagestart() in /usr/local/apache/htdocs/modules/Forums/cafeshop.php on line 31

Here is my code for the cafeshop.php file

Code:
<?php
/***************************************************************************
*                        CafePress Modification for phpbb
*                            -------------------
*   begin                : 1 December 2002
*   copyright            : (C) 2002 Edward Polack
*   email                : pollix@drunksquids.com
*   original author      : Jack Keller (cell7.org) as a stand alone for his site.
*
*   $Id: cafepress.php
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

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

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

//
// Start output of page
//
$page_title = 'Your Store';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

function open_store($storeid) 
{

    global $target, $template;
    global $QUERY_STRING;

    //Set to 0 to use your own stylesheet
    $UseCafePressStyleSheet = 0;

    if (!isset($target) || $target == "store") 
    {
        $get = "store.aspx?s=$storeid";
    } 
    else 
    {
        $qstr = $QUERY_STRING;
        $target = preg_replace("/http:\/\/www.cafeshops.com\/cp\//", "", $target);
        $qstr = preg_replace("target=$target/","",$qstr);
        $get = "store.aspx?s=$storeid";
    }
    
    $fp = @fopen("http://www.cafeshops.com/cp/".$get,"r");
    $countdown = 0;
    $oncountdown = 0;
    $out = 0;
    while (!feof($fp)) 
    {
        $line = fgets($fp,4096);
        $line = stripslashes($line);
        if ($UseCafePressStyleSheet == 1) 
        {
            if (preg_match("/stylesheet/i",$line)) 
            {
                $out = 1;
            }
        }
        if (preg_match("/<script/i",$line)) 
        {
            $out = 1;
        }
        if ($target == "prod") 
        {
            $line = preg_replace("/\/cp\//","http://www.cafeshops.com/cp/",$line);
            $line = ereg_replace("img/hat","http://www.cafeshops.com/cp/img/hat",$line);
            $line = ereg_replace("img/jerseys","http://www.cafeshops.com/cp/img/jerseys",$line);
            if(eregi("",$line)) 
            {
                $countdown = 2; 
                $oncountdown = 1;
            }
            if(eregi("",$line)) 
            {
                $countdown = 6; 
                $oncountdown = 0;
            }
        } 
        else 
        {
            // following line fixes broken image bug if a product has no customized image on it
            $line = preg_replace("/\/cp\//","http://www.cafeshops.com/cp/",$line);
            if (eregi("<!-- ### Items",$line)) 
            {
                $out = 1;
            }
            if (eregi("<!-- ### end of Items",$line)) 
            {
                $out = 0;
            }
        }
        if ($out) 
        {
            // following if statement fixes problem with product page javascript
            if (preg_match("/language/i",$line)) 
            {
                $line = ereg_replace("src=\"/","src=\"http://www.cafeshops.com/",$line);
            }
			 // Added to amend links to absolute cafepress links - Dean (http://www.countersnipe.co.uk/)          
			$line = ereg_replace("href=\"/","target=\"_blank\" href=\"http://www.cafeshops.com/",$line);
            $template->assign_block_vars( 'cafeshop', array(
                'LINE' => $line
                )
            );
        }
    
        if (preg_match("/stylesheet/i",$line)) 
        {
            $out = 0;
        }
    
        if (preg_match("/<\/script/i",$line)) 
        {
            $out = 0;
        }
    
        if ($countdown > 1) 
        {
            $countdown = $countdown - 1;
        }
        elseif ($countdown == 1) 
        {
            $out = $oncountdown;
            $countdown = 0;
        }
    }
    fclose($fp);
}
// The yourstore can also go yourstore,yourstore2 depending
// on the stores you may have put your friends stores on there
// too if you want.
$template->set_filenames(array('body' => 'cafeshop_body.tpl'));    
open_store("maddenwars");  //Make sure to change 'your_store' to your store ID!!  
$template->pparse('body');
//
// Generate the page
//

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
I know its something simple.

Thnx.

shopop24
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Moderator
 
Status: Offline
Posts: 957
Join Date: Nov 2002
Location: Belgium
07-09-2003, 10:30 AM

Let me modify your file, wait a bit


Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 15
Join Date: May 2003
07-09-2003, 10:32 AM

k, thnx.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Moderator
 
Status: Offline
Posts: 957
Join Date: Nov 2002
Location: Belgium
07-09-2003, 10:34 AM

Code:
<?php 
/*************************************************************************** 
*                        CafePress Modification for phpbb 
*                            ------------------- 
*   begin                : 1 December 2002 
*   copyright            : (C) 2002 Edward Polack 
*   email                : pollix@drunksquids.com 
*   original author      : Jack Keller (cell7.org) as a stand alone for his site. 
* 
*   $Id: cafepress.php 
* 
***************************************************************************/ 

/*************************************************************************** 
* 
*   This program is free software; you can redistribute it and/or modify 
*   it under the terms of the GNU General Public License as published by 
*   the Free Software Foundation; either version 2 of the License, or 
*   (at your option) any later version. 
* 
***************************************************************************/ 
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
require("modules/Forums/nukebb.php");
define('IN_PHPBB', true); 
$phpbb_root_path = 'modules/Forums/';
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

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

// 
// Start output of page 
// 
$page_title = 'Your Store'; 
include('includes/page_header.'.$phpEx);

function open_store($storeid) 
{ 

    global $target, $template; 
    global $QUERY_STRING; 

    //Set to 0 to use your own stylesheet 
    $UseCafePressStyleSheet = 0; 

    if (!isset($target) || $target == "store") 
    { 
        $get = "store.aspx?s=$storeid"; 
    } 
    else 
    { 
        $qstr = $QUERY_STRING; 
        $target = preg_replace("/http:\/\/www.cafeshops.com\/cp\//", "", $target); 
        $qstr = preg_replace("target=$target/","",$qstr); 
        $get = "store.aspx?s=$storeid"; 
    } 
    
    $fp = @fopen("http://www.cafeshops.com/cp/".$get,"r"); 
    $countdown = 0; 
    $oncountdown = 0; 
    $out = 0; 
    while (!feof($fp)) 
    { 
        $line = fgets($fp,4096); 
        $line = stripslashes($line); 
        if ($UseCafePressStyleSheet == 1) 
        { 
            if (preg_match("/stylesheet/i",$line)) 
            { 
                $out = 1; 
            } 
        } 
        if (preg_match("/<script/i",$line)) 
        { 
            $out = 1; 
        } 
        if ($target == "prod") 
        { 
            $line = preg_replace("/\/cp\//","http://www.cafeshops.com/cp/",$line); 
            $line = ereg_replace("img/hat","http://www.cafeshops.com/cp/img/hat",$line); 
            $line = ereg_replace("img/jerseys","http://www.cafeshops.com/cp/img/jerseys",$line); 
            if(eregi("",$line)) 
            { 
                $countdown = 2; 
                $oncountdown = 1; 
            } 
            if(eregi("",$line)) 
            { 
                $countdown = 6; 
                $oncountdown = 0; 
            } 
        } 
        else 
        { 
            // following line fixes broken image bug if a product has no customized image on it 
            $line = preg_replace("/\/cp\//","http://www.cafeshops.com/cp/",$line); 
            if (eregi("<!-- ### Items",$line)) 
            { 
                $out = 1; 
            } 
            if (eregi("<!-- ### end of Items",$line)) 
            { 
                $out = 0; 
            } 
        } 
        if ($out) 
        { 
            // following if statement fixes problem with product page javascript 
            if (preg_match("/language/i",$line)) 
            { 
                $line = ereg_replace("src=\"/","src=\"http://www.cafeshops.com/",$line); 
            } 
          // Added to amend links to absolute cafepress links - Dean (http://www.countersnipe.co.uk/)          
         $line = ereg_replace("href=\"/","target=\"_blank\" href=\"http://www.cafeshops.com/",$line); 
            $template->assign_block_vars( 'cafeshop', array( 
                'LINE' => $line 
                ) 
            ); 
        } 
    
        if (preg_match("/stylesheet/i",$line)) 
        { 
            $out = 0; 
        } 
    
        if (preg_match("/<\/script/i",$line)) 
        { 
            $out = 0; 
        } 
    
        if ($countdown > 1) 
        { 
            $countdown = $countdown - 1; 
        } 
        elseif ($countdown == 1) 
        { 
            $out = $oncountdown; 
            $countdown = 0; 
        } 
    } 
    fclose($fp); 
} 
// The yourstore can also go yourstore,yourstore2 depending 
// on the stores you may have put your friends stores on there 
// too if you want. 
$template->set_filenames(array('body' => 'cafeshop_body.tpl'));    
open_store("maddenwars");  //Make sure to change 'your_store' to your store ID!!  
$template->pparse('body'); 
// 
// Generate the page 
// 

include('includes/page_tail.'.$phpEx);
?>
hope this will do it


Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thnx
Old
  (#5 (permalink))
Junior Member
 
Status: Offline
Posts: 15
Join Date: May 2003
Thnx - 07-09-2003, 10:41 AM

Thnx Mighty_Y.

You have been a lot of help lately. I appreciate all your work and assistance. Donation coming your way bro on nukemods.

Take care.

shopop24
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#6 (permalink))
Moderator
 
Status: Offline
Posts: 957
Join Date: Nov 2002
Location: Belgium
07-09-2003, 03:02 PM

Thanks, really appreciate that


Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31