Tutorials
Wallpaper gallery
-
Wallpaper gallery
Posted on December 26, 2003
Written by
Sasha (view more by Sasha)
Comments (0)
Filed under Movable Type, Tutorials
I have recently been working on using MT for uses that are a bit different than your standard blog or updates page. I am currently using MT to maintain nearly ALL aspects of my sites, including my fan sites, and this is the first in a series of tutorials showing you how to make your life easier with MT. I will show you how to use MT to maintain a Wallpaper Gallery, like I am currently doing on HalloweenTown. Yes, this gallery is completely maintained by Movable Type, there are no other programs involved.
You’ll need MT installed for this (v2.x - NOT TESTED ON MT3.x!) on the site you want to use this on. I have only tested this on the MySQL version of MT. It will probably work on the Berkley version as well, but I haven’t tested it, so beware. This tutorial will also assume that you’re using PHP Headers and Footers on your site, although you can easily use it without these… It’ll just make your site a bit slower and less easy to maintain. If you’re not using PHP, just put in the full HTML coding in wherever I refer to include(”header.php”); and include(”footer.php”);
-
Log into your MT control panel and click the Create new Weblog link. Fill in the following information on the next screen:
Weblog name: Wallpapers
Local Site Path: [the absolute path to your site should already be filled in, like /home/user/public_html/mt. Replace everything after the public_html bit with wp: /home/user/public_html/wp
Site URL: [the URL to your site should already be filled in, but replace everything after your site’s URL with wp: http://yourdomain.com/wp/
Local Archive Path: Fill in the same here as you put down for Local Site Path.
Archive URL: Fill in the same here as you put down for Site URL.Click the Save button. Your blog has now been created.
-
Open up your FTP program, and connect to your website. Create a new folder named wp, and CHMOD this folder to 777. This is needed to allow MT to put files in that directory.
-
Switch back to MT. After you clicked the Save button in step 1, you should now be in the Weblog Configuration Screen for your new Wallpapers blog. Click on the Preferences Link near the top of the screen (see image). Change the following things:
Default Text Formatting for new entries: Set this to None.
Default Post Status: Set this to Publish.
File extension for archive files: Set this to "php" (without quotation marks).
Allow Comments default: Set this to Closed.Leave everything else the way it was and click save.
-
Now click on the link next to Preferences that says Archiving. Uncheck the box next to Individual, and check the box next to Category. In the text field after Category Archive, put the following:
<$MTCategoryLabel dirify="1"$>.php
Click Save.
-
Go back to the Preferences Page, and scroll down until you see the option for Preferred Archive Type. Change this to Category. Click Save again, and then go into Templates (in the navigation bar on the left side of the screen).
-
Under Index templates, delete all templates except for the Main Index. Under Archive-Related Templates, delete all except for Category Archive and Date-Based Archive.
-
Click on Main Index Template, delete all the coding currently in there and put the following code into it:
<?php include("../header.inc"); ?> <h2>Wallpapers</h2> <div align="center">Currently <strong><MTBlogEntryCount></strong> Wallpapers archived.</div> <p>All wallpapers are categorized by Creator and by the date they were added to the site. Please click any of the links below to see all wallpapers in that category or month.</p> <h3>By Creator</h3> <ul><MTCategories> <li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a> (<MTCategoryCount> <?php if (<MTCategoryCount> == 1) { echo "wallpaper"; } else { echo "wallpapers";} ?>)</li> </MTCategories></ul> <h3>By Date Added</h3> <ul> <MTArchiveList archive_type="Monthly"> <li><a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a> (<$MTArchiveCount$> added)</li> </MTArchiveList> </ul> <?php include("../footer.inc"); ?>Put in "index.php" under Output File, and click save. The code above assumes you have your PHP header and footer in the folder above the wp one, if this is not the case remember to change the path.
-
Go back into Templates, and click on the Category Archive Template. Delete all the coding in there, and replace it with the following:
<?php include("../header.inc"); ?> <h2><$MTArchiveTitle$>'s Wallpapers</h2> <div align="center"><table border="0"> <MTGrid num_columns="2"> <MTEntries> <MTGridCell> <MTGridIfLeftColumn><tr></MTGridIfLeftColumn> <td><div align="center"> <img src="<$MTEntryExcerpt$>" /><br/> <a href="<$MTEntryBody$>" target="_blank">800x600</a> <MTEntryIfExtended> * <a href="<$MTEntryMore$>" target="_blank">1024x768</a></MTEntryIfExtended></div> </td> <MTGridIfRightColumn></tr></MTGridIfRightColumn> </MTGridCell> </MTEntries> <MTGridTrailingCells> <MTGridIfLeftColumn></tr></MTGridIfLeftColumn> <td> </td> <MTGridIfRightColumn></tr></MTGridIfRightColumn> </MTGridTrailingCells> </MTGrid> </table></div> <p>< <a href="index.php">Back</a></p> <?php include("../footer.inc"); ?>Click save, If you had to change the path to your PHP header and footer in step 7, do it here as well.
-
Go back into Templates again, and now choose the Date-Based Archive template. Delete all coding in here as well, and replace it with:
<?php include("../header.inc"); ?> <h2>Wallpapers Added In <$MTArchiveTitle$></h2> <p>Below are all wallpapers added to HalloweenTown in <$MTArchiveTitle$>.</p> <div align="center"><table border="0"> <MTGrid num_columns="2"> <MTEntries> <MTGridCell> <MTGridIfLeftColumn><tr></MTGridIfLeftColumn> <td> <img src="<$MTEntryExcerpt$>" border="0" /><br/> <a href="<$MTEntryBody$>" target="_blank">800x600</a> <MTEntryIfExtended> * <a href="<$MTEntryMore$>" target="_blank">1024x768</a></MTEntryIfExtended><br /> Made By <a href="<$MTEntryLink archive_type="Category"$>"><MTEntryCategory></a> </td> <MTGridIfRightColumn></tr></MTGridIfRightColumn> </MTGridCell> </MTEntries> <MTGridTrailingCells> <MTGridIfLeftColumn></tr></MTGridIfLeftColumn> <td> </td> <MTGridIfRightColumn></tr></MTGridIfRightColumn> </MTGridTrailingCells> </MTGrid> </table></div> <?php include("../footer.inc"); ?>The same goes for the headers and footers again, change them if they’re in another folder, and click Save when you’re done.
-
Now, anyone who has used MT before, will have spotted a couple of tags in the above coding that they might not have seen before. That’s because we are using a MT Plugins to create a table. This way, the wallpapers will be displayed in rows and columns, instead of all in one long list. Click here to download the plugin we need for this, MTGrid. Unzip the zip file, and upload the .pl file in it to your MT plugin folder. This folder is located in the folder where you installed MT (the same folder that holds mt.cgi). If it’s not there, just create a folder named "plugins". That’s all you need to do to install this plugin. Easy, eh?
That’s basically it!! Now you are ready to start adding wallpapers to your gallery. In this gallery, we are using the Categories as the names of the creators of the wallpapers.
Open up your FTP program, and upload all the wallpapers you want to add (if you haven’t done this already).
Then switch back to MT and click on the New Entry in the navigation bar. Type something descriptive for this wallpaper in the title field. Under Primary Category, choose the name of the person who created this category. If it’s not there, choose Add new category, and type in that person’s name. Under Entry Body, type in the URL to the 800×600 sized version of the wallpaper. Under Extended Entry, type in the URL to the 1024×768 version. If that version doesn’t exist, just leave it blank. And under Excerpt, type in the URL to the thumbnail version of the wallpaper. Click Save, and that’s it! New wallpaper added!
There are many other possibilities you can add to this gallery. For example, instead of having the thumbnail link to the full sized wallpapers, you can turn on Individual Archiving, have the thumbnail link to the Individual Page, and turn on Comments for it. This would enable all visitors to leave comments on the wallpapers.
Or, another example, you can use the Supplemental Category Tags Plugin to put each author’s website URL on the Category pages (like I did at HalloweenTown).
You could even install the Vote Plugin to allow visitors to vote for each wallpaper!
The possibilities are seriously almost endless. This was just a very basic example of what else you can do with MT besides normal blogs, and it’s more written to try and get you to think differently than to be the ultimate tutorial on this subject. Hopefully this opened your eyes a little to the things you can do with MT if you think outside the box.
Comments
Comments are closed for this entry.