Jump to content

Need Help: How do I create new variables and impliment them?


toasty

Recommended Posts

I've been scouring the web for help with custimization to some existing PHP code I've got my hands on and I'm really hoping that someone here can help me out or at the very least point me in a useful direction. I'm developing a website that makes use of PHP and MySQL for its handling of some of its features. I'm hessitant to mention it because of the stigma the genre seems to have developed over the years, but nonetheless I need some help.

My website will feature two key sections: One will be a regular post of news, articles, updates and editorials. The second feature will be a regularly updated and archived collection of images. Although the website is by no means of the garden variety the common street name for such a website is that of a "webcomic".

If you can, please put aside any preconceived notions you might have about the insurmountable number of webcomics that are horrendous and a bad use of server drive space. Please if you will, look at this thread as a request for aid from one web designer to several others.

Because I lack the PHP/MySQL knowhow I am building the navigation of the "webcomic" around the appliation [a href=\"http://www.comikaze.org\" target=\"_blank\"]Comikaze[/a] which works very near to brilliantly for what I'm trying to do. However, the disadvantage is when it comes to navigation of the "news" and the "comics".

With the unmodified code, the News posts are directly linked to the IDs of the comics (the database makes use of 4 tables: Users, IDs, Comics, and News). By default, when you view a comic the corresponding news post(s) are displayed on the same page. What I'm trying to achieve is to break the page down into two seperate pages, one to view the comics and one to view the posts. Each of them (comics and news) will be able to be navigated independant of one another.

I've figured out how to get a page to display *only* the comic(s) or *only* the news post(s). So that's taken care of. Likewise I can setup the pages so that you can navigate through the archived news *or* you can navigate through the comics.... but because of how the variables seem to be setup both cannot be navigated through independantly.

If you want to see an example of the navigation format, [a href=\"http://www.penny-arcade.org\" target=\"_blank\"]Penny Arcade[/a] has achieved essentially what I'm after: news post navigation that is independant of the comic navigation.

The Comikaze code has a set of variables that perform the navigation in a default archive page called "archive_page.php".

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?=$comic->firstButton?>
<?=$comic->prevButton?>
<?=$comic->archiveButton?>
<?=$comic->nextButton?>
<?=$comic->latestButton?>[/quote]

From what I can tell these variables do two things: One, they are linked to display whatever image file is associated with the navigation buttons (something you can setup in Comikaze's config interface). And two the call up the function to change the page to the appropriate comic ID.

I've figured out how to change the code so that either the comic *or* the news post is what is displayed on this the "archive_page.php" page. So my idea was if I can create a second set of variables I can point them to navigate on a *new* archive page.

So my question after all this long banter is this: [!--coloro:green--][span style=\"color:green\"][!--/coloro--]How can I create a set of variables in this code and tell them to navigate through my own archive page *completely* independantly of the built in variables mentioned above?[!--colorc--][/span][!--/colorc--]

I've been working on this off and on for months and now my sites launch date looms on the horizon, I really need to get this done because it's very important for personal and business reasons. If anyone can help, please let me know and I'm more then willing to answer as many questions as I can.

Thank you very much!

- Toasty.
Link to comment
Share on other sites

<?=$comic->prevButton?>
<?=$comic->archiveButton?>
<?=$comic->nextButton?>
<?=$comic->latestButton?>

Your dealing in OOP land. $comic, in the above is used as a "pointer" to class variables. The class is declared somewhere in the code like " $comic = new Class_Name(); ".

Within the class itself you can declare a class variable by simply typing " var $my_var; ", what you can and can't do with them is another story.

In the above, the coder is using the class variable OUTSIDE of the class. If the variable is used INSIDE the class then " $this-> " would replace " $comic-> ".

OOP extends beyond php, in order to understand/work with the above you need to understand OOP used in PHP. To understand OOP used in PHP you need to understand OOP. To understand OOP you need to read a JAVA book.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.