Sylverblog Manual
Contents
1. Installation
Update from a previous version
Update from 5.0 beta
Update from 5.0 stable
New Install
2. Setting up your blog
Blog or gallery mode
Editing layouts
Included pages: search, browse all, mailinglist
Adding additional pages
Making categories
Comment display
3. Uploading and adding images
4. Editing images
5. RSS Feeds
6. All available template variables
Copyright info
--------------------------------
1. Installation
Updating to version 5 will be a bit tricky because I basically rewrote all of the code. I also changed the template system,
so I'm afraid you will have to rewrite your templates (the variable names and filenames have changed).
I'm sorry for this but to create more flexibility I decided to make use of a ready-to-use template engine.
For more information, see the Layout section.
To update, download the sylverblog update package first. Backup your template files and database (I don't want to be responsible if anything goes wrong!).
Upload everything to your sylverblog folder.
Delete admin.php from your sylverblog main folder (it now resides in the admin folder).
You may also delete settings.php in de include directory and index.xml in the main directory (they are obsolete, rss.php in the main directory now is your rss feed).
Point your browser to http://your-domain.com/your_sylverblog_directory/update.php .
This script will update your database with the necessary table fields.
Log in to your admin panel (used to be http://your-domain.com/your_sylverblog_directory/admin.php, is now http://your-domain.com/your_sylverblog_directory/admin/index.php ).
Go to your settings. You will probably have to re-enter all of your settings.
Now update your templates (see below). Hopefully everything should work. If not, panic!
Download the update package and upload the files to your server. DO NOT upload the template files and config.php from the include directory.
You will have to edit a table in the database. If you have phpmyadmin and know how to handle it, you can execute the following query :
ALTER TABLE sylverblog_comments ADD `timestamp` INT NULL;
Otherwise create a document named update_comments.php in your main sylverblog folder and copy the following text into it:
<?
include("include/db.php");
$query = 'ALTER TABLE '.$table_comments.' ADD `timestamp` INT NULL;';
mysql_query($query);
?>
Upload it to the server and point open it once with your webbrowser.
Download the update package and upload the files to your server. DO NOT upload the template files and config.php from the include directory. That's it.
1. Upload all files from the Sylverblog zip file to the directory where you want your photolog to go. For uploading, you need an FTP program.
2. Open the file install.php in your browser (eg: http://www.yourdomain.com/photoblog/install.php). Follow the instructions on the screen. If everything went well, you will see some messages and a notice that the installation has finished successfully. If you are finished installing Sylverblog, make sure to delete the file install.php from your server.
You can now point your browser to admin/index.php, log in with your chosen password and start setting up your blog.
--------------------------------
2. Setting Up Your Site
Sylverblog comes with blog- and gallery functionality. The default is set to Blog mode (all photos will be shown chronologically).
If you want to run Sylverblog in gallery mode, open the index.php file and in line 7 (where it says $display_mode = 0;) , set display_mode to 1
(so it says : $display_mode = 1; ).
If you want to run a blog and a gallery, copy the file index.php, rename it as you desire (eg. gallery.php) and in that file,
do the same as said above. So you now have two files, one with display_mode 0 and one with display_mode 1.
Sylverblog has been set up in a way which offers an extreme amount of flexibility when it comes to customization. Many of the components are separated out into unique variables, or tags, which look like {this}. each unique tag represents a different chunk of data. A full list of these tags is at the bottom of this document.
There are two ways to edit your layouts.
One is via your admin panel. Log in to the admin panel and go to the EDIT LAYOUTS menu. Select the appropriate layouts to edit. What you now see are templates. There are several tags you can use to make your templates (see below). You can completely edit the layouts the way you like.
The second way to edit your templates is offline. They are in the TEMPLATES folder. Edit them in whichever editor you like and upload them to the TEMPLATES directory. You can do anything you'd like with your templates, but please leave a link to Sylverblog somewhere on your site. If you are uploading your modified templates, make sure to chmod them to 777.
For a detailed description of all available variables, please see further below.
There are 3 pages included in Sylverblog for you to use.
SEARCH: this pages lets people search through your photos by keywords.
BROWSE ALL: this page displays the thumbnails of all of your photos. You can set the number of images per page in your configuration.
MAILING LIST: lets people subscribe to a mailinglist. They will then be notified of new photos. If you have the mailinglist disabled, make sure you won't link to that page, since people would still be able to subscribe, but they would never receive a notification!
To include any of these pages to your site, simply make a link to:
index.php?page=search or
index.php?page=all or
index.php?page=mailinglist
(or if your file name is different than index.php, use your file name ;-) )
You can edit the layouts of all of these pages in the layout menu.
Just like in the example above, you can add any page you want. Simply direct the links to:
index.php?page=yourpage.html or index.php?page=yourpage.php
These pages must be placed in the content directory you have selected in your configuration.
You can use php scripts if you want to, they will be executed and the output will be displayed correctly within the templates.
You can also use the Sylverblog template variables within these pages.
In your admin panel you can create top categories and normal categories. Normal categories have a top category as parent.
Categories will be used when Sylverblog is run in gallery mode. You can assign these categories as you are adding new images.
There are two ways of displaying the comments:
1) in a popup window.
2) on the page itself.
You can set the comment displaying options in the CONFIGURATION menu in the admin panel. If you choose to place the comment on the page itself, you have the option to show the comments by default.
If you do not enable that option, clicking on the commentlink will display the comments whereever you have specified to display them in your templates with the ${comments} tag.
Another click on the link will hide the comments again.
3. Uploading and Adding Images
Uploading an image doesn't make it display on your blog. It just makes it available for you to display. There are 2 ways of uploading images.
1) With your own ftp program:
a. Open your ftp program.
b. Upload all new images to the IMAGES directory. You may create subdirectories if you'd like to keep your images directory organized.
2) Go to the admin panel and choose UPLOAD IMAGES from the menu. A JavaApplet will let you select and upload images.
Adding images is when you are making an uploaded image display on your blog:
Go to ADD NEW IMAGES. Do not interrupt if the pages loads a bit slowly.
Enter all of the details you want to enter. You don't need to enter anything if you don't want to. You can choose not to upload any images this time, to do so simply uncheck the checkbox ADD NOW. You image will not be added and it will show up the next time you go to add new images.
You can optionally choose a date and time when the images should be added. When you choose a date in the future, images will be added on the moment the first person opens your website after the time has passed. If you leave it blank or choose a date in the past, the image will be added immediately.
The correct time format is anything that the php strtotime function can parse. Eg : yyyy-mm-dd hh:mm:ss or yyyy-mm-dd or next monday.
You can choose to rotate the images. The button exif rotate automatically rotates the images according to their exif orientation.
Or you can use the little arrows to rotate. You can also choose to resize one (the little button with the rectangle) or all (button on top of the page) images according to the maximum image size you have specified in
the configuration panel.
Note: if you have uploaded your images via ftp, rotating and resizing will probably not work if you are on a linux server due to file restrictions.
It should always work if you have uploaded via the java applet.
Choose whether you want your mailinglist to be notified or not. If you have the mailinglist disabled, this option will not be available.
Hit Ok and that's it.
Image Queue:
If you have images that are going to be added in the future, you will find those images under QUEUED IMAGES. From here, you can change the date and time to add images, or you can immediately add those images.
4. Editing Images
Log into your admin panel.
Now visit your blog or gallery. You will notice a small X in the top left corner. Browse to the image you want to edit and click on the X. It will take you
to the edit page.
If you check DISABLE in the menu, the image will not be visible in your blog anymore.
It will be still be visible in the gallery in the according category! Uncheck the categories if you don't want the image to be visible anywhere.
If you want to edit a disabled images, use the EDIT DISABLED IMAGES option from the admin menu.
If you'd like to edit the thumbnail size of your thumbnails, go to the CONFIGURATION menu. Choose the new thumbnail size. In the main admin menu, click on REBUILD THUMBNAILS.
5. RSS Feeds
Sylverblog has an option to create RSS feeds. You can enable or disable RSS in the CONFIGURATION menu.
If you don't know what RSS feeds are, take a look at the wikipedia entry for RSS. The rss feed file is rss.php. It will generate as many enties as you have set in the configuration, along with the photo itself, the title and the description.
6. All Available template variables
Sylverblog templates are built using the MiniTemplator template engine.
It makes use of variables (eg ${varable_name}) and blocks (eg <!-- $BeginBlock block_name --> content goes here <!-- $EndBlock block_name -->)
Sometimes a block needs to be added in order to view certain content.
A lot of variables belong to some block.
Blocks exists to hide certain content in some cases (eg the link to the previous image will not be added if there is no previous image)
or to repeat certain content (eg in the overview page of all images, a block contains one image and will be added
again and again for each image that will be shown on the page).
Below you will find an overview of all variables and blocks that can be used in each file. Variables that are shown
within a block are supposed to stay within that block in the template.
Have a look at the default template files to get a better understanding of how the templates work.
Gallery overview (gallery_overview.tpl)
Displays an overview of all your categories in gallery mode.
<!-- $BeginBlock top_category -->
${top_name}
The name of the top gallery
<!-- $BeginBlock category -->
${image} Image belonging to a category as chosen in admin panel
${name} name of the category
${description} obvious ;)
${url} generates the url to the category overview page
<!-- $EndBlock category -->
<!-- $EndBlock top_category -->
General
${custom1} Contents of the custom1 template
${custom2} Contents of the custom2 template
${recentX} generates the most recent X thumbnails according to the recent template
${java} place in the head section of your file - necessary for the comment window
${random_url} url to a random photo
${random_image} img src of a random photo
${random} thumbnail of a random photo with link to the page
${visible} Number of visible photos in your blog
${thumbX_image} source of image with id x
${thumbX_url} url to page with id x
${thumbX} thumbnail with link to image with id x
Main part (blog_main.tpl and gallery_main.tpl)
${previousX} generates the previous X thumbnails according to the previous template
${nextX} generates the next X thumbnails according to the next template
<!-- $BeginBlock back -->
${back_url} url to the previous photo
${back_image} filename of the previous photo (thumbnail)
${back} thumbnail with link of the previous photo
<!-- $EndBlock back -->
<!-- $BeginBlock next -->
${next_url} url to the next photo
${next_image} filename of the photo (thumbnail)
${next} thumbnail with link of the next photo
<!-- $EndBlock next -->
${image} filename of the current file (with the right directories)
${file} source of the current image (without the directories - use if you want to create a link to a hi-res file that is located in another folder, for example)
${date} date that this image was added
${title} title of the image
<!-- $BeginBlock text -->
${text} text of the image. If no text, then this block text will not be added
<!-- $EndBlock text -->
${custom} custom text field of the image
${width} width of the image
${height} height of the
${this} filename of current image (thumbnail)
${this thumbnail} thumbnail image of the current image (with img tag)
${gallery_name} prints the gallery name (if in gallery mode)
${gallery_link} generates an url to the main page of the current gallery (if in gallery mode)
<!-- $BeginBlock comments --> only shown if comments are enabled
${comment_link} link to the comments
${comment_count} number of comments
${comments} if comments are shown on the page, this is where the comments will be included
<!-- $EndBlock comments -->
<!-- $BeginBlock exif -->
${exif_make} Camera Manufacturer and Camera Model
${exif_exposure} Photo exposure
${exif_fnum} Photo aperture
${exif_iso} Photo iso
${exif_focallength} Photo focal length (cameraspecific)
${exif_date} Date photo was taken. Uses the date format specified in the admin panel
${exif_35mm} Focal length equivalent in 35mm
${exif_flash} On or Off according to whether a flash was used
<!-- $EndBlock exif -->
Overview template (blog_all.tpl and gallery_all.tpl)
<!-- $BeginBlock page -->
These are the page links in the page navigation.
page_link : link to another page
page_active : the active page
<!-- $BeginBlock page_link -->
${page_number} Page number
${page_url} Url to page
<!-- $EndBlock page_link -->
<!-- $BeginBlock page_active -->
${page_number} Page number
<!-- $EndBlock page_active -->
<!-- $EndBlock page -->
<!-- $BeginBlock image -->
${image} image thumbnail source
${url} url to that image
${title} title of the image
${text} description of the image
${image_full} source of the full sized image
<!-- $EndBlock image -->
${gallery_name} prints the gallery name (if in gallery mode)
${gallery_link} generates an url to the main page of the current gallery (if in gallery mode)
If someone comes from a search, the following variables will also be processed :
${term} search term somebody has searched for
<!-- $BeginBlock found -->
block to add if images were found
<!-- $EndBlock found -->
<!-- $BeginBlock not_found -->
block to add if no images were found
<!-- $EndBlock not_found -->
Next X template (blog_next.tpl and gallery_next.tpl). This will go where you put ${nextX}
<!-- $BeginBlock next -->
${nextX_url}
${nextX_image}
<!-- $EndBlock next -->
Previous X template (blog_previous.tpl and gallery_previous.tpl). This will go where you put ${previousX}
<!-- $BeginBlock previous -->
${previousX_url}
${previousX_image}
<!-- $EndBlock previous -->
Recent X template (blog_recent.tpl and gallery_recent.tpl). This will go where you put ${recentX}
<!-- $BeginBlock recent -->
${recent_url}
${recent_image}
<!-- $EndBlock recent -->
Mailing list (blog_mailinglist and gallery_mailinglist)
<!-- $BeginBlock maildelete -->
Block will be added when someone unsubscribed
<!-- $EndBlock maildelete -->
<!-- $BeginBlock thankyou -->
Block will be added when someone subscribed
<!-- $EndBlock thankyou -->
Search (blog_search.tpl and gallery_search.tpl)
<!-- $BeginBlock searchform -->
Displays the searchform
<!-- $EndBlock searchform -->
Comments (comments.tpl)
${antispam_java} add this to the head of the comments.tpl (or body if there is no head ;) ).This is anti-spam javascript.
Without it, comments will be refused!
<!-- $BeginBlock comment -->
${author} Comment writer
${email} Email of comment writer
${timestamp} Prints the formatted date and time of the comment according to your settings
<!-- $BeginBlock homepage -->
only added if a homepage is available
${homepage} Homepage
<!-- $EndBlock homepage -->
${comment} The comment
<!-- $EndBlock comment -->
${image} img src of the thumbnail of the current image
${date} date that this image was added
${title} title of the image
<!-- $BeginBlock text -->
${text} text of the image. If no text, then this block text will not be added
<!-- $EndBlock text -->
${formheader} usage : <form ${formheader}> produces the right form action etc...DO NOT FORGET or comments will be refused.
${antispam} add this inside of your form. DO NOT FORGET or comments will be refused.
${cookie_name} usage : <input type="text" value="${cookie_name}"...for people who have stored their data
${cookie_mail} see cookie_name
${cookie_url} see cookie_name
<!-- $BeginBlock exif -->
${exif_make} Camera Manufacturer and Camera Model
${exif_exposure} Photo exposure
${exif_fnum} Photo aperture
${exif_iso} Photo iso
${exif_focallength} Photo focal length (cameraspecific)
${exif_date} Date photo was taken. Uses the date format specified in the admin panel
${exif_35mm} Focal length equivalent in 35mm
${exif_flash} On or Off according to whether a flash was used
<!-- $EndBlock exif -->
<!-- $BeginBlock invalidcomment -->
Will be added if a comment is not valid (or the anti spam check fails)
<!-- $EndBlock invalidcomment -->
<!-- $BeginBlock doublecomment -->
if the same comment has already been posted to this photo before by the same author
<!-- $EndBlock doublecomment -->
<!-- $BeginBlock emptycomment -->
if the name or comment field have been left empty
<!-- $EndBlock emptycomment -->
That's it. If there are any other questions, check the FAQ or send me a note.
Sylverblog is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Sylverblog is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|