SigGen
Contents
|
Intro and Info
Signature/Avatar Generator AddOn for Roster
Download -> http://www.wowroster.net/Downloads/details/id=20.html
Support -> http://www.wowroster.net/Forums/viewforum/f=38.html
Current version: 0.2.4
Updated: 19:59, 9 March 2007 (UTC)
Author: Zanix
This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. So if it blows up your server it's not my fault
These signatures/avatars can be used for web forums, they will show a character's level, membership, rank, tradeskill levels, and other such information.
The information in these signature graphics will be as up to date as the information in roster.
This is very configurable, everything can be moved fairly easily, text colors can be changed, almost everything can be displayed/hidden
To configure, open /roster/addon.php?roster_addon_name=siggen
in a web-browser
For members that haven't uploaded info, this will show limited information on a default background
Change Log
Thanks
All props to the original creator(s) of img.php
Ripped from the readme of img.php
Code written by Tony Fontaine, aka Reolus, tonyfontaine@knightraven.net http://www.gnomishmarinecorps.com
Inspired by the WoWSigCreator by Ashenfield ( ashenfield@gmail.com ) http://www.dizzarian.com
rubricsinger | For his eXP bar and therefore making want to improve on img.php |
zeth_russ | Etag cacheing (lovin' the reduced server load!) |
RossiRat | Ideas on showing debug/error info Getting the full path for fonts, directories Shadow fonts Saving images to a directory on the server |
BlackCat83 | For the original "avatar.php" using my code from "sig.php" |
Jessy | For making "av.php" just plug into "sig.php" - Very nice |
Matt Miller | Code from UniAdmin. Without it I couldn't of made the config page |
Ahrtvuailla | For help with re-designing the sigconfig page, and a way to delete uploaded images |
Suirion | For the great race-gender-class images, thanks! |
nekromant | esES localization |
Harut | frFR localization |
To everyone else that I haven't mentioned
And all those that have tested the previous versions; sig1.5 : sig2.0 : sig2.0-gamma
Requirements
WoWRoster.net Roster v1.7.2 or higher
PHP 4.3.2 or better
GD2 with PNG and Freetype Support
Advanced functions in SigGen Config may not work ifsafe_mode
is turnedon
in your PHP config file
SigGen
absolutely requires that your PHP installation supports the GD2 library, and that GD2 hasPNG Support
andFreeType Support
turned on
RosterDiag MUST SAYFreeType Support: yes
for you to use SigGen
FreeType Linkage: with freetype
is best althoughwith TTF
may work ok
If you have trouble with the signature generator, first check RosterDiag for information about how the GD2 library is configured (or not available) on your web server
If you DO NOT want SigGen, or if you cannot get GD2 to work on your server, you can just delete the folder from the addons directory/addons/siggen/
and that will remove all traces of SigGen
File Structure
Here are the files as of v0.2.3 and where they should be located -->
Here are the files and where they should be located -->
- /addons/
- /siggen/
- av.php (avatar front end)
- conf.php
- default.css
- index.php
- localization.php
- menu.php
- sig.php (signature front end)
- siggen.php (siggen generator code)
- trigger.php (auto-save character image trigger file)
- /ava/ (default avatar saved folder)
- /img/
- (*).png
- /background/
- /imagepacks/
- /character/
- /imagepacks/
- /class/
- /imagepacks/
- /members/ (default location for uploaded per-character images)
- /pvp/
- /imagepacks/
- /inc/
- /color/
- /images/
- (*).gif
- color_functions.js
- js_color_picker_v2.js
- /images/
- functions.inc
- sql.inc
- /color/
- /templates/
- (*).tpl
- /sig/ (default signature saved folder)
- /siggen/
Usage
Use sig.php for signatures, av.php for avatars
They are located in /addons/siggen/
So if your roster URL is http://www.yoursite.com/roster/
The files are at:
Signature: http://www.yoursite.com/roster/addons/siggen/sig.php
Avatar: http://www.yoursite.com/roster/addons/siggen/av.php
To get the graphic for a character named "Bob", use:
- Signature:
- http://www.yoursite.com/roster/addons/siggen/sig.php?member=Bob
- http://www.yoursite.com/roster/addons/siggen/sig.php?member=Bob
- Avatar:
- http://www.yoursite.com/roster/addons/siggen/av.php?member=Bob
Alternatively, you can try to use these:
- Signature:
- http://www.yoursite.com/roster/addons/siggen/sig.php/Bob.png
- http://www.yoursite.com/roster/addons/siggen/sig.php/Bob.png
- Avatar:
- http://www.yoursite.com/roster/addons/siggen/av.php/Bob.png
NOTE: This method for accessing SigGen does not work on all servers
For another method, you can use mod_rewrite to re-write the path to the generator files
To use the this method, you must have an Apache server with mod_rewrite turned on
.htaccess file (for Apache)
(Placed in the roster/ folder)
RewriteEngine on RewriteRule ^(sig|av)/(.*).png$ ./addons/siggen/$1.php?member=$2
There is a way to mimic mod_rewrite on IIS using an ISAPI filter
http://www.iismods.com/url-rewrite/index.htm
You need admin access to your IIS installation
I have not tested this, but I hear it does work
mod_rewrite.ini file (for IIS with URL Rewrite Filter for IIS)
(Placed in the roster/ folder)
Debug 0 Reload 1000 RewriteRule ^(sig|av)/(.*).png$ ./addons/siggen/$1.php?member=$2
With the power of mod_rewrite you can access your images at:
Signature: http://www.yoursite.com/roster/sig/Charactername.png
Avatar: http://www.yoursite.com/roster/av/Charactername.png
Setup
Now that you are sure that GD2 works properly on your server, here is how to get SigGen
working
Before you even start trying to access the signatures/avatars, you need to run the configuration page at http://www.yoursite.com/roster/addon.php?roster_addon_name=siggen
Log-in to SigGen Config
First you will need to Log-In to SigGen config
Fill in the password box
This is the same password that you use to log-in to Roster Config
This config page uses cookies so you don't have to log-in everytime you re-visit this page
Install
This will set up the database tables and will give you great control over the look and feel of your signatures
Hit the big Install
button
The next screen should show the following
Just follow the directions
Upgrade
This mode appears only when the following are true
- You already have the `roster_addon_siggen` table in the database
- You have copied the new version over an old one
- When the database has changed in the new version
If the database has not changed, the upgrade options will not appear
You have two options
- Upgrade with reset
- This is the BEST option
- This will upgrade the data tables and reset everything to defaults
- Upgrade without reset
- This option is not supported
- And yes, I can tell if you choose this option
- Use this only if you are comfortable with editing the database manually as you may have to do so
SigGen Settings
Important Note
Alot of the settings on the SigConfig page have tooltips breifly describing what each function does
It's a VERY good idea to clickSave Settings
after you are done on each page, but it is not required
Note: Some settings will automatically "click" theSave Settings
button
Advanced SigGen Options
The fine art of text placement
There are many options for adjusting the placement of the text within the image Here is a guide on how SigGen calculates where to draw the text
- When "Left" alignment is selected, text is drawn from the starting point, going right
- When "Center" alignment is selected, text is drawn equally from that point on both sides
- When "Right" alignemnt is selected, text is drawn from the starting point, going left
Alignment | Horiz point | Width of text | Starts drawing | Ends drawing |
---|---|---|---|---|
Left | 200 | 50 | 200 | 250 |
0 | 30 | 0 | 30 | |
395 | 10 | 395 | 405 | |
Center | 200 | 50 | 175 | 225 |
0 | 30 | -15 | 15 | |
350 | 10 | 345 | 355 | |
Right | 200 | 50 | 150 | 200 |
0 | 30 | -30 | 0 | |
350 | 10 | 340 | 350 |
Import / Export Settings
New in SigGen 0.2.0, you can export and import your SigGen settings for backup or sharing with others
Export
When exporting, SigGen will only export that config mode
So if you are in Signature config mode, hitting Export
will save the config settings for Signatures
The file saved will be siggen_signature.txt
Import
When importing, SigGen will only accept text files name like this
siggen_configname.txt
Where configname is the name of the config mode you are currently in
SigGen will also deny importing of older and newer setting files
So if you saved from SigGen 0.2.0 (which is DBver 1.2) you cannot upload to a newer version if the DBver has changed
For example, if you have SigGen 0.2.5 and the db version changed to 1.3, then you could not load settings from a DBver lower than 1.3
Consequently, you could not import data saved from SigGen with DBver 1.3 to SigGen with DBver 1.2
Image Packs
New for SigGen 0.2.0, you can now use image packs
Image packs have a limited "themeing" ability in that you can specify code to handle how images are selected
Image packs are structured like so
- img/
- background/
- pack1/
- (image files)
- pack2/
- (image files)
- pack1/
- character/
- pack1/
- char.inc
- (image files)
- pack2/
- char.inc
- (image files)
- pack1/
- class/
- pack1/
- ext.inc
- (image files)
- pack2/
- ext.inc
- (image files)
- pack1/
- pvp/
- pack1/
- ext.inc
- (image files)
- pack2/
- ext.inc
- (image files)
- pack1/
- frame
- (image files)
- level
- (image files)
- background/
Background image packs do not have a config file, there is no need for one since the Web config is already there
Class and PvP image packs have a file called ext.inc
In this file, you specify the image extension tha will be used, either .png, .gif, or .jpg/.jpeg
Character image packs have a file called char.inc
Now this is where is gets interesting
(Some future version of SigGen will have a web config for this part, but not right now)
The char.inc file allows you to make an if statement to tell siggen.php
how to pick a character image
If you do not include this file with a pack, then the default code will pick an image like this
if character has race and gender, get race-gender.png
$char_ext = '.png'; if( !empty($sig_race) ) { // Set race-gender based image if( !empty($sig_gender) ) { // Set race-gender based image $im_user_file = $configData['image_dir'].$configData['char_dir'].$sig_race.'-'.$sig_gender.$char_ext; } // Set race only image else { $im_user_file = $configData['image_dir'].$configData['char_dir'].$sig_race.$char_ext; } } // Set default character image else { $im_user_file = $configData['image_dir'].$configData['char_dir'].$configData['charlogo_default_image']; }
Image packs like the teir3 pack pick an image based on race-gender-class.png
<?php if ( !defined('ROSTER_INSTALLED') ) { exit('Detected invalid access to this file!'); } $char_ext = '.png'; if( !empty($sig_race) ) { // Set race-gender based image if( !empty($sig_gender) ) { // Set race-gender-class based image if( !empty($sig_class) ) { $im_user_file = $configData['image_dir'] . $configData['char_dir'] . $sig_race . '-' . $sig_gender . '-' . strtolower(getEnglishValue($sig_class,$sig_char_locale)) . $char_ext; } else { $im_user_file = $configData['image_dir'] . $configData['char_dir'] . $sig_race . '-' . $sig_gender . $char_ext; } } // Set race only image else { $im_user_file = $configData['image_dir'].$configData['char_dir'].$sig_race.$char_ext; } } // Set default character image else { $im_user_file = $configData['image_dir'].$configData['char_dir'].$configData['charlogo_default_image']; }
siggen.php Direct Access and URL Switches
These are the arguments siggen.php will accept (applicable to sig.php, and av.php as well)
- ( member=string ) The name for the script to retrieve and display
- ( mode=string ) What config setting to get from the db ( current options: 'signature' | 'avatar' )
- ( saveonly=[ 1 | 0 ] ) Turns on/off "Save Only Mode"
- ( etag=[ 1 | 0 ] ) Turns on/off "eTag" caching
- ( format=string ) Sets image output format ( current options: 'png' | 'jpg' | 'gif' )
Custom Member Images
Upload
You can set custom images for each character for SigGen, and you can set a custom background as well
Getting images of characters
- Take a screenshot of your character in WoW
- Or even better, use WoW Model Viewer - http://www.wowmodelviewer.org
- Open your screenshot in your favorite image editor
- Edit out the background (make it transparent) and resize to fit inside the signature
- (With SigGen default settings, a good size is h-85px w-120px)
- Save it as .png, .gif, or .jpg format (24-bit .png with transparency is best and recommended)
- Backgrounds MUST be saved as .png or .jpg, .gif is not allowed
Uploading to SigGen Config
The images you upload can be in .png, .gif, or .jpg format (24-bit .png with transparency is best and recommended)
- Pick the name you want to upload for from the pull down list
- Pick what image type you wish to upload ( Character Image | Background Image )
- Browse to the image you wish to upload
- Hit upload, SigGen Config will tell you if it was successful or not
Delete Member Images
This box will let you delete any currently uploaded images
- Pick the file you want to delete from the pull down list
- Hit delete, SigGen Config will tell you if it was successful or not
Save Image Mode
This is how "Save Image Mode" works
When activated, every visit to siggen.php, sig.php, or av.php, when a name is specified, will generate the image and save it to the server as a static image
This mode is generally used in conjunction with the "Addon Update Trigger"
- Jpeg image quality
- This controls the level of detail when images are saved in .jpg format
- Gif image dithering
- This controls the image dithering mode when images are saved in .gif format
- Save images to server
- This activates/de-activates "Save Image Mode"
- Suppress Image Output
- Activating this will suppress image output when siggen.php, sig.php, or av.php are accessed directly, but still generate the image and save it to the server's disk
- Saved images directory
- This is the directory that SigGen will write the generated images to
- The directory specified here will be a full qualified path on your webserver
- There is some help with this pathing
- Use %s% to specify the SigGen directory (%s% may equal /home/webuser/public_html/roster/addons/siggen/)
- Use %r% to specify the Roster directory (%r% may equal /home/webuser/public_html/roster/)
- There is some help with this pathing
- If you change this directory, SigGen Config will try to create the new directory, but it will not move any images that are in the old directory to the new one, nor will it delete them
- Default Directories
- Signatures: %s%sig/
- Avatars: %s%ava/
- Saved images format
- The format in which SigGen will sve the image to the server
- Current choices are gif, jpeg, png
- Saved images Prefix/Suffix
- The text specified here will be added to the filename of the saved image
- Example
- The character's name is "Billybobjo"
- Saved image format is "jpeg"
- Prefix is set to "prefix-"
- Suffix is set to "-suffix"
- The saved image on the server will be "prefix-Billybobjo-suffix.jpg"
Auto-Save Images
Character Update
Auto-Save images for signatures and avatars
Combining the powers of "Save Image Mode" and "Addon Update Triggers", images can be automaticaly generated and saved on the server everytime update.php is ran
Turning these on will generate and save an image to the server's disk when a player updates their data
Only turn these on after you have configured the signatures
The "Saved Images Directory" has to exist for this to work
To activate, turn on "Auto-save image on character update" on the Main Settings page
Guild Update
This "auto-save mode" can also run during a guild update, which generates an image for every guild memeber
To activate, turn on "Auto-save images on guild update" on the Main Settings page
Important Note
You must also check the "Run Update Triggers" on update.php to activate this mode
WARNING: This can take a very long time.
Expect to wait up to 10 minutes, maybe even longer when this is activated
An image is generated and placed on the update page for every member in the guild
Please wait for the page to fully finish downloading all the images to have all of them saved correctly
FAQ/Troubleshooting
Known bugs/weirdness
- Turing off "Display Skill Description" when "Display Riding Skill" is turned on will not remove the Riding Skill Description
- This is by design
- Save Images box is red and the only option is "Save images to server" and below that is "Save Image Functions Disabled"
- This is either because "Save images to server" is turned off or the Saved Images Directoy doesn´t exist
- Background Selection Configuration shows as "DISABLED"
- This is disabled because "Default Background Override" is ON
- Selecting a new background image pack will reset all options for background images
- You MUST reset all the options when changing the background image pack
- Selecting a new character image pack will reset the default character image option
- You MUST reset this when changing the character image pack
- Auto-Save Images doesn't work when uploading with UniUploader
- Enable the "UniUploader Fix" in SigGen Config, "allow_url_fopen" MUST be enabled on your web server!
General FAQ
- Reset to the default settings
- Check the box and hit Default Settings to reset to defaults
Important note: When you edit this page, you agree to release your contribution into the public domain. |