Re: I've even got that "noob" smell - basic questions (I searched :( )

So, maybe at this point, I should just throw in the towel and seek a simpler solution...

I'm not a programmer, but I did want to add a forum to my website.  I really like the idea of hosting it myself, to, rather than paying for hosting and having an ajeepthing.someboard.com address... sad

Oh well, c'est la vie.

Re: I've even got that "noob" smell - basic questions (I searched :( )

Nah, I wouldn't say that, I could write a mod to do it tonight: I'm just at school now so it's harder tongue

Re: I've even got that "noob" smell - basic questions (I searched :( )

Sorry - that wasn't meant to be a post to spur you on...LOL

When folks are willing to help me with technical things I become quite patient... smile

Re: I've even got that "noob" smell - basic questions (I searched :( )

sportsguy: If enabling write access to the cache folder didn't help, e-mail your host and tell them to do it for you. Tell them that you have a PHP script that needs to be able to save files to that folder.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: I've even got that "noob" smell - basic questions (I searched :( )

sportsguy wrote:

Sorry - that wasn't meant to be a post to spur you on...LOL

When folks are willing to help me with technical things I become quite patient... smile

lol, don't worry, I planned on doing it anyway tongue

31 (edited by Smartys 2005-09-22 23:06)

Re: I've even got that "noob" smell - basic questions (I searched :( )

And on that note (this is untested btw, you'll have to tell me if you have problems: oh, and in the interest of saving some time I've "disabled" quickjump altogether, to save me having to rework the cache for it):
One "new" file (redone enough that I didn't do just line by line replacements):
include/cache.php

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB 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.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
    exit;
    
//
// Generate the config cache PHP script
//
function generate_config_cache()
{
    global $pun_config, $db;

    // Get the forum config from the DB
    $result = $db->query('SELECT * FROM '.$db->prefix.'config', true) or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
    while ($cur_config_item = $db->fetch_row($result))
        $pun_config[$cur_config_item[0]] = $cur_config_item[1];
}


//
// Generate the bans cache PHP script
//
function generate_bans_cache()
{
    global $pun_bans, $db;

    // Get the ban list from the DB
    $result = $db->query('SELECT * FROM '.$db->prefix.'bans', true) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
    
    $pun_bans = array();
    while ($cur_ban = $db->fetch_assoc($result))
        $pun_bans[] = $cur_ban;
}


//
// Generate the ranks cache PHP script
//
function generate_ranks_cache()
{
    global $pun_ranks, $db;

    // Get the rank list from the DB
    $result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());

    $pun_ranks = array();
    while ($cur_rank = $db->fetch_assoc($result))
        $pun_ranks[] = $cur_rank;
}

And now for the edits!

include/common.php
FIND

// Load cached config
@include PUN_ROOT.'cache/cache_config.php';
if (!defined('PUN_CONFIG_LOADED'))
{
    require PUN_ROOT.'include/cache.php';
    generate_config_cache();
    require PUN_ROOT.'cache/cache_config.php';
}

REPLACE WITH

require PUN_ROOT.'include/cache.php';
generate_config_cache();

FIND

// Load cached bans
@include PUN_ROOT.'cache/cache_bans.php';
if (!defined('PUN_BANS_LOADED'))
{
    require_once PUN_ROOT.'include/cache.php';
    generate_bans_cache();
    require PUN_ROOT.'cache/cache_bans.php';
}

REPLACE WITH

require_once PUN_ROOT.'include/cache.php';
generate_bans_cache();

include/functions.php

FIND

    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
    {
        @include PUN_ROOT.'cache/cache_ranks.php';
        if (!defined('PUN_RANKS_LOADED'))
        {
            require_once PUN_ROOT.'include/cache.php';
            generate_ranks_cache();
            require PUN_ROOT.'cache/cache_ranks.php';
        }
    }

REPLACE WITH

    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
    {
        require_once PUN_ROOT.'include/cache.php';
        generate_ranks_cache();
    }

footer.php
FIND

    // Display the "Jump to" drop list
    if ($pun_config['o_quickjump'] == '1')

REPLACE WITH

    // Display the "Jump to" drop list
    if ($pun_config['o_quickjump'] == '1' && 1 == 2)

Re: I've even got that "noob" smell - basic questions (I searched :( )

Well, I tried those changes and I'm still seeing a blank page at the URL. sad (Though I do appreciate your time on this.)

33 (edited by Smartys 2005-09-23 16:11)

Re: I've even got that "noob" smell - basic questions (I searched :( )

Mmm, undo whatever you did to the cache.php file, that could be causing it
(And to be clear, I mean that thing that was supposed to make the stuff writable)