Short SigGen URLs for Roster 2.0

A signature and avatar generator addon

Moderator: zanix

Short SigGen URLs for Roster 2.0

Postby zanix » Sat Jan 26, 2008 9:28 am

End-all be-all working way for shorter SigGen URLS!

Allows you to use

Code: Select all
http://www.site.com/roster/MODE/Name@US-Realm.EXT

Replace MODE with the config setting (IE. signature | avatar)
Replace Name@US-Realm with the character's name region and realm
Replace EXT with the extension (IE. png | gif | jpg)

This only allows for the signature and avatar SigGen config designs
If you added other designs, you have to add them in the .htaccess file
Code: Select all
RewriteRule ^/?(signature|avatar|anotherconfig|more|purple)/(.*)



Of course mod_rewrite needs to be enabled and working on your server!

Edit Roster's .htaccess file
After
Code: Select all
   # ENABLE ENGINE
   RewriteEngine On


Add
Code: Select all
   # SIGEN REWRITE
   RewriteRule ^/?(signature|avatar)/(.*)\.(.*)$ /index.php?p=util-siggen-$1&member=$2&format=$3


So the entire file looks like this
Code: Select all
# WoWRoster .htaccess file
# $Id: .htaccess 1254 2007-08-19 16:41:28Z Zanix $

# ONLY IF MOD_REWRITE IS INSTALLED
<IfModule mod_rewrite.c>
   # ENABLE ENGINE
   RewriteEngine On
   
   # SIGEN REWRITE
   RewriteRule ^/?(signature|avatar)/(.*)\.(.*)$ /index.php?p=util-siggen-$1&member=$2&format=$3

   # CONIDITIONS
   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -d

   # REWRITE RULES
   RewriteRule ^(.+) - [PT,L]
   RewriteRule ^(.*) index.php
</IfModule>
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Short SigGen URLs for Roster 2.0

Postby Taralom » Tue Jan 29, 2008 8:30 pm

I use the following one to make it even shorter...

My roster is located in site_url/r2 and I can call

the signature with:
Code: Select all
site_url/r2/sig/Name.png

the avatar with:
Code: Select all
site_url/r2/ava/Name.png


Code: Select all
# WoWRoster .htaccess file
# $Id: .htaccess 1254 2007-08-19 16:41:28Z Zanix $

# ONLY IF MOD_REWRITE IS INSTALLED
<IfModule mod_rewrite.c>
   # ENABLE ENGINE
   RewriteEngine On

   # SIGEN REWRITE
        RewriteRule ^/?sig/(.*).png$ /r2/index.php?p=util-siggen&mode=signature&member=$1
        RewriteRule ^/?ava/(.*).png$ /r2/index.php?p=util-siggen&mode=avatar&member=$1

   # CONDITIONS
   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -d

   # REWRITE RULES
   RewriteRule ^(.+) - [PT,L]
   RewriteRule ^(.*) /r2/index.php
</IfModule>



But to be honest MOD_Rewrite is Chinese to me, could someone explain the "Conditions" and "Rewrite Rules"? Don't post a link to MOD_REWRITE reference guide , I can google my-self. :wink:

I do understand the 2 rewrite rules I added, but the other ones, even with the reference guide next to me, hmmm... :?: :?: :?:
Taralom
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Sun Sep 03, 2006 5:59 pm

Short SigGen URLs for Roster 2.0

Postby zanix » Tue Jan 29, 2008 11:44 pm

I don't quite understand it either, but I know that these rewrite rules transform
Code: Select all
http://www.site.com/roster/guild/memberslist.html

Into
Code: Select all
http://www.site.com/roster/index.php?p=guild-memberslist


And
Code: Select all
http://www.site.com/roster/char/info/a=c:2.html

Into
Code: Select all
http://www.site.com/roster/index.php?p=char-info&a=c:2


These allow shorter Roster URLs as well, just enable Alternative URLs in RosterCP and all the links in Roster will look like this
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Short SigGen URLs for Roster 2.0

Postby PleegWat » Wed Jan 30, 2008 2:13 am

No they don't. They just tell apache to let an url like

Code: Select all
http://www.site.com/roster/guild/memberslist.html


that doesn't match a file be handled by

$www_root/roster/index.php

The rest of the translation logic is in PHP.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Short SigGen URLs for Roster 2.0

Postby Arkel » Sun Apr 27, 2008 1:54 am

I see this is for normal Roster. It seems the short does not work in the DF format or any of them when I do a copy & paste of the link into the avatar field in DF.
[url=http://www.bronzedragonlords.com]Image
[/url]
User avatar
Arkel
WR.net Journeyman
WR.net Journeyman
 
Posts: 112
Joined: Thu Sep 07, 2006 8:42 am

Short SigGen URLs for Roster 2.0

Postby zanix » Sun Apr 27, 2008 2:08 am

Nope
The rewrite rule needs to be different for DF
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Short SigGen URLs for Roster 2.0

Postby Anaxent » Sun Apr 27, 2008 2:45 am

For DF you would just need to fix the url used for the images like so

Code: Select all
# SIGEN REWRITE
   RewriteRule ^/?(signature|avatar)/(.*)\.(.*)$ /index.php?name=WoWRosterDF&p=util-siggen-$1&member=$2&format=$3
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

Short SigGen URLs for Roster 2.0

Postby Arkel » Sun Apr 27, 2008 9:13 am

Thanks well do
Last edited by Arkel on Sun Apr 27, 2008 9:13 am, edited 1 time in total.
[url=http://www.bronzedragonlords.com]Image
[/url]
User avatar
Arkel
WR.net Journeyman
WR.net Journeyman
 
Posts: 112
Joined: Thu Sep 07, 2006 8:42 am

Short SigGen URLs for Roster 2.0

Postby KaguraS » Fri May 30, 2008 4:03 am

Where can I change the long link displayed in the SigGen page.

I want change it from

Code: Select all
http://domain.com/index.php?p=util-siggen-avatar&a=c:340&member=Player@Realm

http://domain.com/index.php?p=util-siggen-signature&a=c:340&member=Player@Realm


to the saved image by uploading the CharacterProfiler.lua

Code: Select all
http://domain.com/saved/Avatar-player.png and
http://domain.com/saved/Signature-player.png



because my host do not allow the .htacess, and the long link is not accepted in forums as a valid image.

This was easy in 1.7.3 but in 2.0 I don't know how.
Last edited by KaguraS on Fri May 30, 2008 4:03 am, edited 1 time in total.
User avatar
KaguraS
WR.net Apprentice
WR.net Apprentice
 
Posts: 40
Joined: Wed Feb 20, 2008 8:44 am

Short SigGen URLs for Roster 2.0

Postby zanix » Fri May 30, 2008 4:56 am

There is a setting in SigGen Config
I don't recall the exact name, and I don't have the current version of SigGen running on my server at the moment
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Short SigGen URLs for Roster 2.0

Postby KaguraS » Fri May 30, 2008 6:44 am

ah, I didnt see that option before, but I have to remove the @ in some lines in siggen.php and char/index.php because the browser returns a 404 error.
User avatar
KaguraS
WR.net Apprentice
WR.net Apprentice
 
Posts: 40
Joined: Wed Feb 20, 2008 8:44 am

Short SigGen URLs for Roster 2.0

Postby zanix » Fri May 30, 2008 7:06 am

The file that actually displays the links is siggen/char/index.php
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Short SigGen URLs for Roster 2.0

Postby Kilmarac » Wed Jul 09, 2008 10:19 pm

Hrm,

I had this working, but after the updated siggen went in, it doesnt want to work anymore.

I have this in my htaccess

Code: Select all
        # SIGEN REWRITE
        RewriteRule ^/?sig/(.*).png$ /r2/index.php?p=util-siggen&mode=signature&member=$1
        RewriteRule ^/?ava/(.*).png$ /r2/index.php?p=util-siggen&mode=avatar&member=$1
User avatar
Kilmarac
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Tue Oct 09, 2007 7:54 am

Short SigGen URLs for Roster 2.0

Postby zanix » Thu Jul 10, 2008 8:03 am

Make sure you can access the images directly and that you are not getting an error
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Short SigGen URLs for Roster 2.0

Postby ScratchMonkey » Wed Nov 26, 2008 10:20 am

Feature request: add a setting with a pair of regex values that replaces the canonical sig/avatar URL with a "short" URL and then use that in the member's siggen page. This allows members to easily get the short URL for their image by right-clicking it on the siggen page and copying the URL.

What's needed is essentially the reverse of the mod_rewrite rule.
Image
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA


Return to SigGen

Who is online

Users browsing this forum: No registered users and 0 guests

cron