Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
A simple webcomic viewer script??
Old 12-27-2007, 03:34 PM A simple webcomic viewer script??
Experienced Talker

Posts: 33
Trades: 0
Hi guys,

I make comics on my Nucleus CMS (PHP/MySQL, like Wordpress only not as cool) blog and would like to implement a comic viewer at the top of the main index (3-column layout) to allow visitors to easily scan through the comics.

What I'd really like is a basic webcomic viewer with first, previous, next and latest buttons/links at the bottom, like how most webcomics use.

I have found a number of webcomic viewer scripts out there (right now working with autokeenlite, but it's been difficult to set up), but they've all been tough to implement into the existing blog architecture.

Anyone have any experience configuring a webcomic viewer on their site or have any suggestions? Thanks in advance.

Regards,
kermit
__________________

Please login or register to view this content. Registration is FREE
kermit4karate is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-09-2008, 11:52 PM Re: A simple webcomic viewer script??
Mirz's Avatar
Junior Talker

Posts: 1
Trades: 0
Have you found any solution to your issue? I am looking for something similar. A basic webcomic viewer using javascript, which would allowing viewing online or on the User's computer. Any help would be greatly appreciated.
__________________

Please login or register to view this content. Registration is FREE
Mirz is offline
Reply With Quote
View Public Profile
 
Old 01-10-2008, 11:16 AM Re: A simple webcomic viewer script??
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Here is what I would work from (might not answer question exactly):
PHP Code:
<?php
$comic_id 
$_GET['id']; // Get variable from URL
if(is_numeric($comic_id)){ // Good check for SQL Injections
    
$comic_url "http://www.comicsite.com/comics/"."{$comic_id}".".png"// Build URL
    
if(@file_get_contents($comic_url)){ // If the file exists.
        
echo "HTML FOR COMIC"// Return the html
    
}
}
?>
You could also do a include for the information about the comic.

PHP Code:
<?php
$comic_id 
$_GET['id']; // Get variable from URL
if(is_numeric($comic_id)){ // Good check for SQL Injections
    
$comic_url "comics/"."{$comic_id}".".inc.php"// Build URL
    
if(@include($comic_url)){ // If the details an be included.
        
echo "HTML FOR COMIC"// Return the html
    
} else { // There was a server error because the file can't be included.
        
echo "Oh noes! That comic does not exist.";
    } 
} else { 
// Comic is not a number. Log IP here, could be an attempted hack.
echo "Sorry, there was a problem loading the comic."
}
?>
The next/prev buttons are just a matter of checking something is there.
PHP Code:
<?php
$comic_id 
$_GET['id']; // Get variable from URL
if(is_numeric($comic_id)){ // Good check for SQL Injections
    
$comic_url "comics/"."{$comic_id}".".inc.php"// Build URL
    
if(@include($comic_url)){ // If the details an be included.
        
echo "HTML FOR COMIC"// Return the html
    
} else { // There was a server error because the file can't be included.
        
echo "Oh noes! That comic does not exist.";
    } 

    
// Now lets do to those next/prev buttons.
    
$comic_url_prev "comics/"."{$comic_id 1}".".inc.php"// Build New URL
    
if(@file_get_contents($comic_url_prev)){
        echo 
"Prev"// Make Link
    
} else {
        echo 
"Prev"// Don't Make Link
    
}
    
$comic_url_next "comics/"."{$comic_id 1}".".inc.php"// Build New URL
    
if(@file_get_contents($comic_url_prev)){
        echo 
"Next"// Make link
    
} else {
        echo 
"Next"// Don't Make Link
    
}

} else { 
// Comic is not a number. Log IP here, could be an attempted hack.
    
echo "Sorry, there was a problem loading the comic."
}
?>
I'm not amazing at AJAX *uses javascript), but maybe editing the html (inner.html.value="new html for comic" you could reload the comic being shown + it's vars.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 01-10-2008 at 11:32 AM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Reply     « Reply to A simple webcomic viewer script??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.69032 seconds with 12 queries