News:

The anti-spam plugins have stopped being effective. Registration is back to requiring approval. After registering, you must ALSO email me with your username, so that I can manually approve your account.

Main Menu

Updating Comic

Started by golden-crystals, June 09, 2006, 08:53:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

golden-crystals

I'm just starting my website and I've been searching and reading through all the topic on this page, help pages, etc. Anyway, I was just a little confused on how the comic is updated?

Im sorry if this question has already been stated, or been answered. Is there any other 'tutorial' or help thing besides this forum and the 'Help and Info' page?
'In case of stupid, throw a brick'

Golden Crystals - Your journey is before you.

Chow

Update your comic index page to point to your current newest comic, then use the navigation buttons with PHP to minus or plus the current comic's number for the page refresh

(ie: the "next" button will generate the same webpage but the comic variable will be "[comicvariable]+1" so comic #7 would become comic #8 if you hit "next")

if you need code examples let me know.
[some kid]: :cool: "wei long....clever..."
[me]: :/
[Ian]: :mad: "Actually....that's his name, JERK!"
[me]: :lol:

golden-crystals

Yes Please!

I have my site up, but I didn't use PHP, but it still looks ok. I know that my index page should be PHP, I'll have to work on that, but everything else seems to be in working order.

The codes for updating the comics would be great, and maybe a brief brief explaination? Thank you, Chow! ^^
'In case of stupid, throw a brick'

Golden Crystals - Your journey is before you.

Chow

so tired, can't post code now, but I will get into why you need PHP and not just HTML for those comic pages and not just the index (which technically only needs the Xepher box as far as PHP goes)

if you only use HTML, 10 comics means each comic must have it's own page, and the links to those 10 comics point to the 10 different pages. This is a problem when you get around comic #100 or #1000, then you'll have a thousand pages, each with just one comic on it. Imagine if you change your background or banner, you'd have to do it a hundred times!

A PHP page is one page that can change to display different content, like different comics. One page, no fuss...ok some fuss, but more on that in the morning, I'll be back.......
[some kid]: :cool: "wei long....clever..."
[me]: :/
[Ian]: :mad: "Actually....that's his name, JERK!"
[me]: :lol:

Databits

However, php has it's downsides as well. Using standard GET request links isn't all too search engine friendly. Granted, it's probably better to be set up with some sort of templating system, you can technically still change sections of code in multiple documents (html files) very quickly if you know what you're doing on a *nix box.

As for search engine friendly, I find that setting up a php script to parse the REQUEST_URI out from a generated htm or html page within a script is pretty damn good for that. For example:

Using an .htaccess file you can specify a file as an executable PHP file, even if it has no php extension. Now, say you have a script that's used to generate the pages of your comic (for this lets call it comic.php). What you'd do is have the another file that uses an include or require of comic.php called just comic.

Now you can go to http://www.mysite.com/comic and apache will execute comic.php (as the include suggests). But this is just the start. The comic.php script would first parse the REQUEST_URI from the $_SERVER global and pull some unique url from it to generate the page. Because of the way this works, going to the url http://www.mysite.com/comic/comic1page1.html would STILL execute comic.php. So when comic.php executes and parses the url, it would be able to tell that it needs to render comic #1's first page (you can have the URL setup and parse however you like).

Aside from the parsing, the url http://www.mysite.com/comic/comic1page1.html is being handled the same as you would normally handle a GET request like this: http://www.mysite.com/comic.php?comic=1&page=1. The only difference is that a search engine will actually pick this up much easier.


NOTE: Sorry if this seems a bit confusing at the moment it's almost 2:00am and it's been a rough day.
(\_/)    ~Relakuyae D'Selemae
(o.O)    
(")_(")  [Libre Office] [Chrome]

Chow

Good point data, I had not thought about the search engine aspect. I guess I just get an uneasy feeling thinking about a folder with that many HTML pages.

But once a site is big enough, the need to draw people from search engines WOULD be an issue, so I think you've got something there. Google's and Yahoo's should always be kept in mind.
[some kid]: :cool: "wei long....clever..."
[me]: :/
[Ian]: :mad: "Actually....that's his name, JERK!"
[me]: :lol:

Databits

Yeah, I just got finished with a contract that uses a similar system. They're an online bronco parts supplier, so they wanted things to pop up in search engines for their site if say someone searched for a specific part.
(\_/)    ~Relakuyae D'Selemae
(o.O)    
(")_(")  [Libre Office] [Chrome]

golden-crystals

Quote from: DatabitsNow you can go to http://www.mysite.com/comic and apache will execute comic.php (as the include suggests). But this is just the start. The comic.php script would first parse the REQUEST_URI from the $_SERVER global and pull some unique url from it to generate the page. Because of the way this works, going to the url http://www.mysite.com/comic/comic1page1.html would STILL execute comic.php. So when comic.php executes and parses the url, it would be able to tell that it needs to render comic #1's first page (you can have the URL setup and parse however you like).
I used a simular system like this on Comic Genesis, only it wasn't explained as PHP. Pages were updated by date, like if I were to want to post a comic today and tomorrow I would name my files 20060610.jpg and 20060611.jpg, put them in the comic file and it would be done for me.

As for the Next, Back, First, and Last buttons, they were set up in a way that they automatically did what they were coded for. I never had to relink them to every single comic page.

Does Xepher have a similar system? As far as PHP and Apache go, I have been downloading several things, reading countless 'Readme's and 'Installs' and I can't even fathom the concept. Is there a PHP/Apache/Xepher for Dummies?
'In case of stupid, throw a brick'

Golden Crystals - Your journey is before you.

Databits

Ok, now I'm not allowed to disclose exact code due to an NDA (Non-Disclosure Agreement), but here's a VERY basic example of the idea:

.htaccess

  ForceType application/x-httpd-php
comic
  require_once('comic.php');
?>
comic.php
  // URL PARSE CODE HERE

  // PAGE GENERATION, ETC...
?>
In the parse code I suggest using something (URL valid) as a unique method to break up the url. Something like http://www.mysite.com/comic/c1_p5.html.

With that you can use something like the following (note this is a VERY simple model with no error checking or anything):

  // Gets everything after the last "/" in the URL or "c1_p5.html" for this example.
  $url = substr(strrchr($_SERVER['REQUEST_URI'], '/'), 1);  

  // Remove the ".html", ".htm", whatever from the URL by exploding
  // the string into an array and using the first index.
  $url = explode('.', $url);

  // Explode the string into another array to seperate comic and page.
  $url = explode('_', $url[0]);
  $comic = $url[0];
  $page = $url[1];

  // Do whatever you want with the data that's been parsed.
?>
(\_/)    ~Relakuyae D'Selemae
(o.O)    
(")_(")  [Libre Office] [Chrome]

Xepher

Golden-Crystals... I get the impression that you're not actually a programmer. You're looking for some sort of wizard or automagical site generator. There isn't one. ( http://xepher.net/index.php?page=faq ) You have to find/install/write your own scripts for things like this. Xepher.net doesn't provide anything. Take a look at some scripts like http://walrus.newbsoft.com/ or http://atp.cx/?a=downloads if you need to automate a comic.

golden-crystals

lol, no, I'm not a programmer wizard. I was just wondering if Xepher had anything like that,  but if I have to link everything manually, I will.Thank you all for the links and the codes, I really appreciate it.
'In case of stupid, throw a brick'

Golden Crystals - Your journey is before you.

fesworks

ah, i've been looking for something like that! Learning full php is just not in the cards for me right now, so hopefully these will help me from updating 3 pages each time I have a new comic :P

www.PSIwebcomic.com
www.TheShifterArchive.com
www.ArdraComic.com
www.WebcomicBeacon.com

Databits

Which is all the more reason for you to finish your comic system Xeph. :P
(\_/)    ~Relakuyae D'Selemae
(o.O)    
(")_(")  [Libre Office] [Chrome]

Xepher

Yeah yeah... I'm slow, I know it. :-)

jekkal

I think I get what's going on here, but still a little flustered . . .

So, in theory I can just post my strip, update the ID # on comic php (or whatever I use) and use that on the front page rather than actually updating the index, yes?

Sorry, crawling here. @_@ I'm still trying to wrap my head around how to do the layout with this behemoth of a page.