Session problems:
No attempt to get my user data from my cookies when i open the page initially (apparently anyways) yet it says I'm logged in?
But on a refresh, I'm logged out.
Is there going to be a "remember me" option for signing in?
Are you doing "logged in as anonyomous"?
UPDATE sessions SET running='1110348246', loc='logform', content='0' WHERE ip='65.31.98.213' AND id=''
No id = Unless no one has id's, the query won't affect any rows.
Proposed Class Structure
<?php
if (!defined( 'ROOT_PATH' )){ die("Wtfage? Access Denied"); }
class code_usercp
{
var $nav = array();
var $output = "";
function initialize() // this will be changed to function {class name} soon... so in this instance, it will be function code_usercp()
{
// set up class environment
global $vars, $display;
$this->nav[0] = "<a href='?p=usercp'>My Control Panel</a>";
$this->html = $display->load_skin_i("usercp");
// Switch goes here and you can modifiy $this-output in
numerous ways.
// My style is clearly shown in the tutorials script
$this->output = $this->html->wrapper_test();
/*
finish the class up... after your switch executes, you'll end up back in this function so you only need to declare this once... You can handle this different ways too, for example, using a variable $this-location for the session update and change it depending on where you are in your switch... $this->location = "Logging In...", $this-> location = "Registering".
*/
$display->finish(array('title' => "My Control Panel", 'nav' => $this->nav, 'html' => $this->output, 'session' => array("Configuring Control Panel", $whatever, "")));
}
}
?>
<?php class usercp {
function wrapper_test()
{
$html = <<<EOF
Test<br/>
EOF;
return $html;
}
} ?>
Works, I tested it and all my functions
.
I'm not forcing you to convert the scripts you've done, but this structure is highly efficent. You'll learn to love it. After doing many, many mods, trust me...
Another little tip, the nav array is super sexy. At the start of your mod, you can declare nav[0] as "My control panel"... if you branch off into a "area", you can change nav[0] to be a link. This is kinda done amoung mods made by peers, although, not as easily. They do it the hard way and declare an entire nav array branch in every switch, just like you want to with strings. Meh... I just declare 0 as a link to start off with and leave it. However, [1] and such changes from text to link as they navigate deeper into the script.
One things that's really annoying me thus far is having the same file names for a code and skin class. Seriously. I mentioned this before but even with setting up basic class structure and hardly doing any work, it's annoying the shit out of me.
My idea:
Put all the files in one directory. Naming scheme:
{$path}/{$mod}_skin.php
{$path}/{$mod}_code.php
You won't have to constantly switch directories while working on a mod + zero confusion of what directory you're actually in or what file you're overwritting.
Files would be catagorized efficently...
forum_code.php
forum_skin.php
profile_code.php
profile_skin.php
usercp_code.php
usercp_skin.php
The title variable needs some defination... for example, our current download script, I believe, sets the title to
BOARD_NAME -> Catagory -> File
and such, somewhat like a nav array.
We could declare the title the same as the nav array, however, I'm already seeing some instances where that might be annoying, maybe not.
However, handling both would be more annoying.
Or... we could have it just auotmatically set to
BOARD_NAME -> {$mod title}
with nothing after that.
Hmmm? I'm leading towards either copying the nav array as a title or having the class handle it's own title seperately, most likely, in a array format like the nav system.
We could also change the finish function to be less messy by doing this:
$display->finish($this->output, $this->nav, "My Control Panel", array("Configuring Control Panel", $whatever, ""));
if you want to remember the exact order of how things are passed in, soyou would also have to declare all 4 parts in each function call (FALSE for unused), which wouldn't be too bad since you usually only call it once and usually would declare all 4 parts anyways.
keke... I know this is probably too big of a post to contemplate all at once...
Everytime I write this huge ass report on something, you respond with one line and I'm like wtf? okay?
Anyways, store ideas:
Topic highlight... You can choose a predefined color for your topic titles in topic view (light green, darkish green...)... costs semi-high so it's not abusable... for example, beer might have made his picture thread green so it stands out more.
Post icons... It's a lovely feature, I tend to forget to use it though, however, it does make a topic stand out a lot more... so what if it costs a extremely low fee to use them? I don't like this idea as much, but it's worth stating
.
I dunno, we just need more store items to make a store mod worthwhile and fun. Having like 3 items is worthless.
Forum index script:
I'm not sure if you're planning on adding a statistical page to the bottom of the script, but, either we move the list of online users today to my stats mod or make it collapsed (thus, collapsable) by default.
This post has been edited approximently 9 times.