Staredit Network

Staredit Network -> Staff Lounge -> Top secert
Report, edit, etc...Posted by IsolatedPurity on 2005-03-03 at 17:23:07

Since you're away mellow.gif:
How about $sen-> as a super wrapper?
$sen->member[id];
$sen->configuration[whatever];
$sen->session[browser];
etc...

And... can we keep comments clean? I mean, I know they're professional in many ways, but basic things like:
// Is there no zone input? Lets give it one! Garharhar!
really don't need to be there happy.gif.
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-03 at 17:55:38
But I have fun programming when I do stuff like that happy.gif
Report, edit, etc...Posted by Mini Moose 2707 on 2005-03-03 at 19:55:32
Does it matter if it looks professional? Its not like we're realeasing a major new brand of forum software to the public. tongue.gif
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-03 at 20:50:39
Thats what im saying...
Report, edit, etc...Posted by Clokr_ on 2005-03-04 at 07:32:41
Being profesional helps a lot when more than one person is working with the same code. Even when you are working alone, if you have to modify a function that you didn't modify in a long time comments are really helpful, and that kind of comments are... well... not really that helpful tongue.gif
Report, edit, etc...Posted by IsolatedPurity on 2005-03-04 at 08:57:57
Some major changes I'm making:
Debughtml will be a global variable... $vars->debug[html]. This will allow other variables like $vars->debug[querycount] and $vars->debug[script_time]. Want to echo the debug info out? Just replace <% DEBUG %> in the global wrapper! Or... whatever we will use for macros and such.
mysql.php will automatically connect to the database via class constructor, instead of having a seperate function for it and having to call it.
Moved /data/functions/ to /routines/... please? happy.gif (or something similiar)
Defined some more paths and will use them as such (SKIN_PATH, LAYOUT_PATH)

// IP wants a config file... so he gets a config file...
Lol... trust me, if there's anything you might want to change on the fly, you'll want one too. Otherwise, hard coding everything well end up in even more script rewrites. Perhaps we won't have an advanced acp config wizard like invision, but changing options like about:config in firefox works just as fine for us non-noobs.
Besides editing skin templates directly, I wouldn't have mind editing this directly in invision smile.gif (as well as, css... global wrapper... etc, I hate invision wizards).
Anyways, moved to root... it's good there.

mysql.php is about done... looks like invision but there isn't much you can really do with functions like:
function optimize ($table)
{return $this->query("OPTIMIZE TABLE {$table}");}
Although we said we were getting away from noobish sql functions, I added a delete() because once I used a delete statement and deleted an entire table accidently happy.gif. Plus, $sql->delete(array("","") looks sexy and it'll be seperated from $sql->query("") organizationally within mods (at least, for me anyways, you don't have to use them).
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-04 at 09:28:16
You can add whichever sql functinos you want. Yah, config is cool dont worry. We'll make a little config page later.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-03-04 at 10:33:05
I'm in a Visual Basic class now I just compleated my IF ELSE assignment so

HA HA HA YOU GUYS SUCK YOU CAN NEVER LIVE UP TO ME. tongue.gif
There, now i feel smart
Report, edit, etc...Posted by chuiu on 2005-03-04 at 11:12:54
Rofl I completed VB class #2 about a year ago. I need to take C# and Assembler right now...
Report, edit, etc...Posted by BeeR_KeG on 2005-03-04 at 21:10:18
I finished my BBCode self-learning class a long time ago. I pretty much don't know anything else...

HA HA HA YOU GUYS SUCK YOU CAN NEVER LIVE UP TO ME. tongue.gif
There, now i feel smart

I just had to.

Anyways, I don't know if this is posible with all that .php stuff but would it be posible to "link" different types of code, like the Tutorials where you post a link to a thread and post. If that thread and map get deleted, the links to the thread and map will be removed because they were "linked". Also pictures which aren't available can also be auto-removed. This will be done because the "link" will enable the effects to take place everywhere along the chain.
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-05 at 00:55:10
I got some emoticons to replace the ones we'll lose. Its not too much and they're smaller, but they're good.
Report, edit, etc...Posted by chuiu on 2005-03-05 at 02:33:10
QUOTE
affilierate system here


Wow ... I'm speechless. tongue.gif
Report, edit, etc...Posted by IsolatedPurity on 2005-03-05 at 15:30:08
So anyways, shit that I think needs to be changed:

Consistancy:
Either we use 100% function names like this_is_our_function() or thisisourfunction().
Using _'s between words looks cleaner.

function numrows()
{
return mysql_num_rows($this->lastsql);
}

function get_insert_id()
{
return mysql_insert_id($this->connection);
}
... I mean, mysql's internal functions use _'s. It's for a natural reason. Why rename num_rows as numrows? I just don't get it.

Using portals.php as a skin and code class name doesn't work for me. I could use the skin function to call "skin_class" but then we'll have files like login.php and then skin_portal.php. Might look messy... It's just when I have like 10+ files open, two portals.php looks gay.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Instead of:
$selection->initialize();
why don't we just delete the line and use the classes constructor as autorun?
class hello {
function hello () { }
}
for an example template. So, instead of having a login.php initialize(), there would be a "function login(){ }".


Instead of having three functions to add to display's class, one (not necessarily exactly as defined here - just as an example)
$display->add_page (array( 'html' => $this->html, 'nav' => $this->nav, 'title' => $this->title).
function add_page ($input) {
if ($input[html]) $this->content .= $input[html];
if ($input[title]) $this->title .= $input[title];
etc...
}
Anyways, this will allow you to call the function with just a nav update, if you wish (god knows why you actually would until your script is done executing)... I'll change the nav update section to allow a string or an array.

I wanna rename functions.php to something else because it's too similiar to function. Doesn't make too many changes because you'll be using $do-> to access it.


$vars->session = new session;
$vars->session->check_session();

Use your class constructor. I still really don't see why you need to place session into $vars because the session class should be handling all it's data internally. Any access outside this class should be done inside the class.

Perhaps $SQL instead of $sql? $SQL->query or $sql->query. Not necessary, just wondering what you think.
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-05 at 15:35:30
Whichever you prefer... I put some underscores in one sql function... the rest are okay I think.
Report, edit, etc...Posted by Clokr_ on 2005-03-05 at 15:51:29
QUOTE(isolatedpurity @ Mar 5 2005, 09:30 PM)
Consistancy:
Either we use 100% function names like this_is_our_function() or thisisourfunction().
Using _'s between words looks cleaner.
[right][snapback]159014[/snapback][/right]


I always name them like this: ThisIsOurFunction
_s are ugly tongue.gif
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-05 at 22:08:12
Warning and error systems are pretty cool:

Error:
Accepts multiple errors and displays them all for the user to see in this cool transparent box:
[attachmentid=5980]


Warnings:
The way invision is, whenever you screw up on a form, it usually brings you to an error page, then you press back, and SOMETIMES lose data. No more! Warnings will display at the top for forms and places where you screw up and a page is still outputted:
[attachmentid=5981]
Report, edit, etc...Posted by IsolatedPurity on 2005-03-06 at 07:42:09
I likey...

Editz0rz: Added that finish function. Not exactly sure if it works like intended yet... but this is how I personally would use it in an optimized script like the tutorial system (where I only call it once happy.gif):
$display->finish(array('title' => "Tutorial System", 'nav' => $this->nav, 'html' => $this->content, 'session' => array("Tutorial", $id, "")));

Sure, it looks a bit messy, but it's efficent. I left the old add functions in there so your login script still works.

So... what if we made $vars and $sql global? Meaning, you'll never have to declare them in a function, they'll be there automatically. Think there might be any drawbacks to that? Almost every function uses them anyways... and with that, maybe we can change $vars->session to $session because you'll only call that in your login script and the saved effort of typing global $vars, $sql could be turned into global $session tongue.gif.
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-06 at 09:29:57
You need to update session on every page because:
1. It will update the time the user has been on the site, which means they will not be automatically logged out.
2. Depending on the 10 character key you add in, it will also explain on the online list where they are as well.
Report, edit, etc...Posted by IsolatedPurity on 2005-03-06 at 10:35:15
Not with the new function happy.gif.
Report, edit, etc...Posted by IsolatedPurity on 2005-03-09 at 01:06:03
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 happy.gif
$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 happy.gif.
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 happy.gif.

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.
Report, edit, etc...Posted by Yoshi da Sniper on 2005-03-09 at 08:35:17
There will be a remember me and annyomous login for the future. These are easy features.

I have some store ideas too... but lets cross that bridge when we get to it. I'm right now going to be working on forum display, then topic display.

forums.php will contain board index, forum view, and maybe some sort of multi moderation system. I don't know what file we'll put active users in, because its a more global thing, but it could go into forums.php too if you want.

ADDITION:
BTW...if you want post icons... you have to give em to me tongue.gif
Report, edit, etc...Posted by IsolatedPurity on 2005-03-09 at 09:45:21
QUOTE
Everytime I write this huge ass report on something, you respond with one line and I'm like wtf? okay?

See happy.gif... nothing about the proposed template or redoing the struture with mod_skin and mod_code...
It would be nice, especially having the same files in one directory...

QUOTE
I don't know what file we'll put active users in, because its a more global thing, but it could go into forums.php too if you want.


I was thinking of the possibility we could have an active users box in the global skin and then, in the same box, you could have a small section for the users who are currently in that script or page (specific spot in the script, like, what post).
However, that might get kinda ugly....
So I was thinking we could put it on the bottom planet with partial transparency and rearrange what's on the globe now so it would all fit nicely, making it more effiect and not as ugly...
Report, edit, etc...Posted by IsolatedPurity on 2005-03-09 at 13:44:58
So, since you didn't say otherwise, I went ahead and started the conversion...
Directory structure...
/core -- mysql.php, sessions.php, etc (rountines started to annoy me)
/scripts -- usercp_skin.php, usercp_code.php, etc
/scripts/tasks -- task folder... could be moved to /core/tasks, I kinda like that idea, a lot.
/support -- our javascript, css, and non-php related files
/images -- same

display.php has been renamed to global_code.php
global_wrapper.php has been renamed to global_skin.php
accessible via
global $display;
$display->ghtml->simpletable();

could stick it in $vars-> i suppose... $vars->ghtml->simpletable()?

Another thing I want to do is remove the error handling from $do and put it in $display, since it's a display matter.

If you read this in the next few minutes, yeah, not everything's working yet. I'm getting to it.

Editzorz - Converted. Mmmm... I also deleted the old load_skin function and replaced it with my load_skin_i... it's better... more oganized... Forging a skin class in the display class might lead to problems and you'll never use a script skin inside the display class anyways, so, why put it there?
Besides, didn't you not want to use a lot of variables while declaring a function's global vars?
$this->whatever_i_wish_to_call_my_skin_variable = $display->load_skin("forums");
$this->whatever_i_wish_to_call_my_skin_variable->myfunction();
Report, edit, etc...Posted by IsolatedPurity on 2005-03-11 at 02:34:04
Alright, basic template to use transparencies:
<div class="bgb border">
<div class="bgg h">Information</div>
You won the raffle!!! Yay!
</div>

I have yet to find a way to make a class like bgg inherit properties from class h.
It sucks... At least we can call two classes (I didn't know that before).

bgg = BackGround Green
h = Header
bgr = Red
bgb = Black

Rules:
Call a background color first. The IE conversion function searches for class="bg to replace.
A background color must be on the background black to show as intended.

One thing I'm not sure about is making a dark row green. It tends to look very ugly w/ transparencies, I might just keep it opaque. Not too sure how white will turn out either.

Anyways, you can look at the usercp script for implementation.

See... some global changes aren't that bad happy.gif.
Report, edit, etc...Posted by IsolatedPurity on 2005-03-14 at 08:15:33
WHERE p.pid IN(1,2,3,4,5,6,7,8,9,10)
unnecessary.

Anyways, I was thinking at work...
What if we did some type of threaded forum... but keep the basic linear format? It's like an attempt to take the best of both styles. I call it tangents... happy.gif
Sample post:
Topic ~ Post your pictures!
Beer: Here's my Picture!
Isolated: Here's my Picture!
---+ Anna responses: You are so cute!
---+ Rexy responses: censored.gif ing sexy...
Yoshi: Here's my picture!

Basically, I guess it's the ability to post comments on a post. It gets really wild if there's the possibility to comment on a comment.
Now... the plus side of using a tangent is you can go somewhat off topic or reply to a post directly without having to quote it or have your post 10 posts away from the one you're talking about. Tangents will not show posters avatars, signatures, and etc. So, it's attempt at a more oganized thread...
Negatives: Tangent abuse by noobs, complexity.

Ideas: Limit tangent length, it'll keep tangents from overtaking the thread. No image bbcode.

Not exactly sure if I like the idea myself, just throwing it out. Perhaps it could be built upon.
Next Page (2)