Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About evhwanabe

  • Rank
    New To The Neighborhood
  1. Image Gallery Problems

    I also changed my template for scry back to setup.........which basically checks to make sure everything is installed correctly and I found this:
  2. Image Gallery Problems

    Bruce, I found this error "client denied by server configuration: /home/username/public_html/photos/index.php"
  3. Image Gallery Problems

    hotlink protection is shown as disabled in Control Panel
  4. Image Gallery Problems

    To keep things simple for this site I decided to try the SCRY Image Gallery. It was working perfect untill the other day. Now all of the sudden when I go to my latest uploaded pictures Here The thumbnails aren't showing. I also am getting alot of "Page forbidden" errors. I have not changed anything and I am not sure why this is doing this, And only on certain galleries. Does it just not like these certain image photos? I have checked the SCRY website and tried all of their suggestions with no luck. Could something have been messed up with my hosting account? Thanks in advance for any help!
  5. Cool owatagal, Thanks for the tip!
  6. First off, let me start by saying I am not an expert in PHP, but I got this work and thought maybe other people could use it. I ran into a problem on my last project where I was using a php include for my navigation bar, No big deal right? But I also wanted to be able to change the class of my active page/link on each page so the button/link looked like it was pressed down. Look here to see what I mean. This is no sweat if you have your nav code on each page, you would just set the class to "active" or whatever and you would be good to go. I wrote this little script to basically check what page I am on, and then set the class active for that page. I now have a php include navbar that knows what page you are currently on and changes the link class accordingly. I am not going to get into the css side of this. I will save that for another time lol. ><? if ($PHP_SELF != '/page1.php') { $page1 = 'none'; } else { $page1 = 'active'; } if ($PHP_SELF != '/page2.php') { $page2 = 'none'; } else { $page2 = 'active'; } if ($PHP_SELF != '/page3.php') { $page3 = 'none'; } else { $page3 = 'active'; } if ($PHP_SELF != '/page4.php') { $page4 = 'none'; } else { $page4 = 'active'; } ?> <ul id="nav"> <li><a href="/page1.php" class="<?echo $page1;?>">page1</a></li> <li><a href="/page2.php" class="<?echo $page2;?>">page2</a></li> <li><a href="/page3.php" class="<?echo $page3;?>">page3</a></li> <li><a href="/page4.php" class="<?echo $page4;?>">page4</a></li> </ul> Like I said, I am not an expert, so if you know of a better way please share.....
  7. Perl Script Problem

    I went back and took another look at my picasa export templates, and ended up finding a stupid error on my part, and got it working in a couple minutes lol. If anyone would like these templates let me know. They are not perfect but seem to atleast get the entries into movable type. Thanks!
  8. Perl Script Problem

    Ok thanks Mike, I will keep looking. The person that developed the script didn't really have any documentation and I am new to perl scripts.
  9. Perl Script Problem

    Yes. scripts directory is also 755
  10. Perl Script Problem

    Hey guys, I am having trouble with a perl script that I downloaded. This is the first perl I have tried to use so bare with me. I have it installed in a folder called /scripts the name of the script is "mt_image_gallery.pl" I got it here My problem is that everytime I run it (which Im not sure Im doing correctly) I get a Internal server error 500 I am running it by just opening my browser and entering www.mysite.com/scripts/mt_image_gallery.pl I checked my error log in cpanel and found that the error is " Premature end of script headers:" hope that helps someone It is supposed to help import photos as entries into Movable Type for use with Doug Bowmans gallery templates. I have tried using Picasa to export galleries with a custom export template and have had no luck. If anyone has a better Idea please let me know! Thanks in advance here is the script. >#!/usr/bin/perl # -------------------------------------------------------------------- # # Name: Export Photos to Movable Type (mt_image_gallery.pl_ # # Function: This script will resize the photos in the directory of your # choice into two sizes: 480x360 (large) and 90x68 (small). # Furthermore, the script will automatically create entries # for those images into the blog of your choice. This # works with Stopdesign.com's Photo Gallery Templates. # # Notes: Remember that your pictures will need to be in 1024x768, # 1600x1200, or 2272x1704 dimensions. The templates are # created for images with those dimensions or images # equivalent to the 4:3 ratio. # # See http://stopdesign.com/templates/photos/ # # Author: Emil Soleyman-Zomalan <emil@nishra.com> # # Bugs: I know that the script has bugs and needs some TLC. I would # appreciate any reports or patches towards improving its # functionality and usefulness. # # TBD * Encrypt the password to hide from memory # * Do more error checking along each step # * Look to resizing the images quicker # * Make a plugin out this # # License: Creative Commons's Attribution-NonCommercial-ShareAlike 2.5 # # Version: 0.3 # -------------------------------------------------------------------- # use Net::MovableType; use File::Basename; use File::Find::Rule::Type; use Term::ReadLine; # Term::ReadLine::Gnu use Image::Magick; use strict; my ($photos_url, $photos_loc, $location, $category, $username, $password); my ($domain, $xmlrpc, $blog_id, $mt); # ---------------------------- # CONFIGURATION # ---------------------------- $domain = ''; # The complete domain name including http:// $category = ''; # The title of the gallery/category $photos_url = ''; # The relative URL to the photos top-level directory $photos_loc = ''; # The file location of the photos templates $location = ''; # The location of the image files $username = ''; # The Movable Type username $password = ''; # API password (important!) $xmlrpc = ''; # The URL of the XML-RPC file $blog_id = ''; # The blog ID of the photo blog # ---------------------------- # MAIN # ---------------------------- # Begin interview process usage(); ask_questions(); # Login to MovableType $mt = login_to_mt(); # Create gallery through use of category function populate_gallery(); # Resize image files into large and small dimensions # Large: 480x360, Small: 90x68 resize_image_files(); # ---------------------------- # SUBROUTINES # ---------------------------- sub usage { print "\nUsage: $0\n\n"; print "The function of this script is to insert entries into the " . "Movable Type blog \nof your choice containing " . "Stopdesign.com's Photo Gallery " . "Templates.\n\n"; print "......................................................." . "....................\n\n"; } sub ask_questions { my ($term, $attribs, $prompt_domain, $prompt_cat, $prompt_photos_url); my ($prompt_photos_loc, $prompt_loc, $prompt_user, $prompt_pass); my ($prompt_xmlrpc, $prompt_blog_id); $term = new Term::ReadLine 'mt_image_gallery'; $attribs = $term->Attribs; # Prompt for category (gallery) name if (!$category) { print "[ Gallery Title ]\n"; print "NOTE: You must create a top-level category within Movable Type\n" . "first. Then cut-and-paste the name in this section.\n"; $prompt_cat = ": "; $category = $term->readline ($prompt_cat); } # Prompt for domain name if (!$domain) { print "\n[ Domain Name ]\n"; print "e.g http://www.domain.com\n"; $prompt_domain = ": "; $domain = $term->readline ($prompt_domain); } # Prompt for photo template URL location if (!$photos_url) { print "\n[ Relative URL of Photo Templates ]\n"; print "e.g /photos/ as in http://www.domain.com/photos/\n"; $prompt_photos_url = ": "; $photos_url = $term->readline ($prompt_photos_url); } # Prompt for photo template file location if (!$photos_loc) { print "\n[ File location of Photo Templates ]\n"; print "e.g /var/www/domain.com/photos \n"; $prompt_photos_loc = ": "; $photos_loc = $term->readline ($prompt_photos_loc); } # Prompt for image location on the hard drive if (!$location) { print "\n[ Image File Location ]\n"; print "e.g /home/user/gallery/sample-photos\n"; $prompt_loc = ": "; $location = $term->readline ($prompt_loc); } # Prompt for username if (!$username) { print "\n[ Blog Username ]\n"; $prompt_user = ": "; $username = $term->readline ($prompt_user); } # Prompt for API password if (!$password) { print "\n[ API Password ]\n"; $prompt_pass = ": "; $attribs->{redisplay_function} = $attribs->{shadow_redisplay}; $password = $term->readline ($prompt_pass); undef $attribs->{redisplay_function}; } # Prompt for xmlrpc location if (!$xmlrpc) { print "\n[ URL of XML-RPC file ]\n"; $prompt_xmlrpc = ": "; $xmlrpc = $term->readline ($prompt_xmlrpc); } # Prompt for blog id if (!$blog_id) { print "\n[ Photo Blog ID ]\n"; $prompt_blog_id = ": "; $blog_id = $term->readline ($prompt_blog_id); } print "\n......................................................." . "....................\n\n"; } sub login_to_mt { my ($mt); $mt = new Net::MovableType("$xmlrpc"); $mt->username("$username"); $mt->password("$password"); # API password; see release notes $mt->blogId("$blog_id"); return ($mt); } sub populate_gallery { my ($temp_entry, $temp_id); # We prime the category so that all of the files and subdirectories # needed by the gallery templates have been created. $temp_entry = { title => "test title", description => "test description" }; $temp_id = $mt->newPost ($temp_entry, 0) or die $mt->errstr; $mt->setPostCategories ($temp_id, "$category"); $mt->publishPost ($temp_id); $mt->deletePost($temp_id); # Delete the bogus post now } sub resize_image_files { my (@images, $image, $temp); my ($name, $path, $suffix); my ($large_name, $small_name, $gallery); my ($entry, $new_id); my ($counter); # Convert category/gallery title to lowercase and replace # whitespace with dashes. This is the same way that the gallery # name is created for the first time. $gallery = lc ($category); $gallery =~ s/ /-/g; $gallery = $gallery . "/gallery/"; # <gallery_title>/gallery/ @images = find ( file => type => 'image/*', in => "$location" ); if (scalar(@images) < 1) { print "WARNING: The application cannot find images at" . "$location. Please check that location and try again.\n"; exit; } else { print "Images are being created in $photos_loc" . "$gallery\n\n"; $counter = 1; foreach (@images) { ($name, $path, $suffix) = fileparse ($_, '\.[^.]*'); # Initialize ImageMagick $image = Image::Magick->new; # Read image $temp = $image->Read ($_); warn "$temp" if "$temp"; # Create large dimension image $large_name = "$name" . "_large" . "$suffix"; $temp = $image->Resize (geometry=>"480x360"); $temp = $image->Write ("$photos_loc" . "$gallery" . "$large_name"); # Create small dimension image $small_name = "$name" . "_small" . "$suffix"; $temp = $image->Resize (geometry=>"90x68"); $temp = $image->Write ("$photos_loc" . "$gallery" . "$small_name"); print "* $name$suffix resized "; # Add an entry for each image $entry = { title => "$category - $counter", description => "<img alt='' title='' src='" . "$domain" . "$photos_url" . "$gallery" . "$large_name" . "' width='480' height='360' />", mt_text_more => "<img alt='' title='' src='" . "$domain" . "$photos_url" . "$gallery" . "$small_name" . "' width='90' height='68' />", }; $new_id = $mt->newPost ($entry, 0) or die $mt->errstr; $mt->setPostCategories ($new_id, "$category"); $mt->publishPost ($new_id); print "& entry created\n"; $counter++; } } }
  11. Importing Entry Problems

    Well it stopped working so I redid the file......and obviously messed something up lol. I will take a look at that text editor. I was using textpad and had line breaks set to UNIX style breaks. I am not sure why the file has a mix of MAC and WIN style breaks. Thanks for all your help.......hopefully I can get this working.
  12. Importing Entry Problems

    David, What editor are you using that you can see all this??? when I open the file it looks fine as far as the spacing is concerned, but the line breaks I cannot see. For some reason when I open the file in my browser I can see that it is double spaced, but when I open it in my text editor it appears single spaced.
  13. Importing Entry Problems

    I spoke to soon! Now its not working at all. here is my picasa export template again. export and here is my latest exported file (what would get imported to MT) entries See anything wrong?
  14. Importing Entry Problems

    I input a bogus date and now the import works......... I don't believe picasa can output a date that is in the format of MT's oh well not a big deal I guess......as long as the rest works. Thanks
  15. Importing Entry Problems

    I re wrote the template from scratch and the new output is what you are looking at.... I tried to import and now it seems to almost work lol it doesnt like the date format... but it did add a new category. I will try and mess with the date format now.