Misstyped Save Path

A signature and avatar generator addon

Moderator: zanix

Misstyped Save Path

Postby Bisa » Sat Jul 22, 2006 3:29 am

While configurating the save path (for signatures) I accidentially misstyped it and now I cannot change it via the http-page.

Since I cannot create the dir
Code: Select all
Saved Signatures Folder doesn't exist
It is required when "Save Image Mode" is turned on
Click HERE to try to create [/home/exiled/www/roster/addons/siggen/../../../signatures/]
Save Image functions are temporarily disabled


clicking th elink "here" gives me the following:
Code: Select all
Warning: mkdir(/home/exiled/www/roster/addons/siggen/../../../signatures/) [function.mkdir]: Permission denied in /home/exiled/www/roster/addons/siggen/inc/functions.inc on line 69


I tried to add the dirs ".." manually but Im not allowed to name them like that :(

could I change it manually via the ftp in some of the config files or something?
Last edited by Bisa on Sat Jul 22, 2006 3:41 am, edited 2 times in total.
User avatar
Bisa
WR.net Apprentice
WR.net Apprentice
 
Posts: 9
Joined: Thu Jul 20, 2006 11:42 pm
Location: Sweden

Misstyped Save Path

Postby zanix » Sat Jul 22, 2006 9:07 am

You cannot set this to a directory outside of addons/siggen/
If you look at the tooltip, it says
SigGen wrote:Specify a directory to save generated images to
Realative to "\roster\addons\siggen"


SigGen was written to only act on it's own directory

Changing this requires quite a few lines to edit

This edit will allow you to set the saved directory as a subfolder of your roster directory


index.php
Find
Code: Select all
if( $_REQUEST['make_dir'] == 'save' )
{
    if( 
$functions->makeDir$sigconfig_dir.$checkData['save_images_dir'] ) )
    {
        
$functions->setMessage("Saved Signatures folder created");
    }
    else
    {
        
$functions->setMessage("Saved Signatures folder COULD NOT be created<br />Create it manually");
    }
}

if( 
$_REQUEST['make_dir'] == 'chmodsave' )
{
    if( 
$functions->checkDir$sigconfig_dir.$checkData['save_images_dir'],1,) )
    {
        
$functions->setMessage("Saved Signatures folder is now writable");
    }
    else
    {
        
$functions->setMessage("Saved Signatures folder COULD NOT be chmod'ed<br />Manually set write access");
    }

Replace with
Code: Select all
if( $_REQUEST['make_dir'] == 'save' )
{
    if( 
$functions->makeDirROSTER_BASE.$checkData['save_images_dir'] ) )
    {
        
$functions->setMessage("Saved Signatures folder created");
    }
    else
    {
        
$functions->setMessage("Saved Signatures folder COULD NOT be created<br />Create it manually");
    }
}

if( 
$_REQUEST['make_dir'] == 'chmodsave' )
{
    if( 
$functions->checkDirROSTER_BASE.$checkData['save_images_dir'],1,) )
    {
        
$functions->setMessage("Saved Signatures folder is now writable");
    }
    else
    {
        
$functions->setMessage("Saved Signatures folder COULD NOT be chmod'ed<br />Manually set write access");
    }


Find
Code: Select all
if( $checkData['save_images'] )
{
    if( !
$functions->checkDir$sigconfig_dir.$checkData['save_images_dir'] ) )
    {
        
$functions->setMessage("Saved Signatures Folder doesn't exist<br />It is required when "Save Image Mode" is turned on<br />Click <a href="$script_filename&amp;make_dir=save">HERE</a> to try to create [<span class="green">".$sigconfig_dir.$checkData['save_images_dir']."</span>]<br />Save Image functions are temporarily disabled");
        
$allow_save false;
    }
    elseif( !
$functions->checkDir$sigconfig_dir.$checkData['save_images_dir'],) )
    {
        
$functions->setMessage("Saved Signatures Folder isn't writable<br />Write access is required when "Save Image Mode" is turned on<br />Click <a href="$script_filename&amp;make_dir=chmodsave">HERE</a> to try to chmod [<span class="green">".$sigconfig_dir.$checkData['save_images_dir']."</span>]<br />Save Image functions are temporarily disabled");
        
$allow_save false;
    }
    else
    {
        
$allow_save true;
    }

Replace with
Code: Select all
if( $checkData['save_images'] )
{
    if( !
$functions->checkDirROSTER_BASE.$checkData['save_images_dir'] ) )
    {
        
$functions->setMessage("Saved Signatures Folder doesn't exist<br />It is required when "Save Image Mode" is turned on<br />Click <a href="$script_filename&amp;make_dir=save">HERE</a> to try to create [<span class="green">".ROSTER_BASE.$checkData['save_images_dir']."</span>]<br />Save Image functions are temporarily disabled");
        
$allow_save false;
    }
    elseif( !
$functions->checkDirROSTER_BASE.$checkData['save_images_dir'],) )
    {
        
$functions->setMessage("Saved Signatures Folder isn't writable<br />Write access is required when "Save Image Mode" is turned on<br />Click <a href="$script_filename&amp;make_dir=chmodsave">HERE</a> to try to chmod [<span class="green">".ROSTER_BASE.$checkData['save_images_dir']."</span>]<br />Save Image functions are temporarily disabled");
        
$allow_save false;
    }
    else
    {
        
$allow_save true;
    }



siggen.php
Find
Code: Select all
$configData['save_images_dir'] = str_replace'/',DIR_SEP,$sigconfig_dir.$configData['save_images_dir'] ); 

Replace with
Code: Select all
$configData['save_images_dir'] = str_replace'/',DIR_SEP,ROSTER_BASE.$configData['save_images_dir'] ); 



And lastly, if you want to fix the tooltips so it shows correctly
templates/sc_body.tpl
Find
Code: Select all
<td class="sc_row<?php echo (((++$row)%2)+1); ?>" align="left"><?php print $functions->createTip'Specify a directory to save generated images to<br />Realative to "'.$sigconfig_dir.'"','Saved images directory' ); ?></td>

Replace with
Code: Select all
<td class="sc_row<?php echo (((++$row)%2)+1); ?>" align="left"><?php print $functions->createTip'Specify a directory to save generated images to<br />Realative to "'.str_replace('\\','/',ROSTER_BASE).'"','Saved images directory' ); ?></td>
Last edited by zanix on Sat Jul 22, 2006 9:25 am, edited 2 times in total.
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: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Misstyped Save Path

Postby Bisa » Sat Jul 22, 2006 2:02 pm

before I even try doing the modifications you mention above I think i need to explain my problem a little further, bcs I think (but im note sure) we have missunderstood each other...

I tried to set the save path to ../../signatures but that did not work, the roster then told me to create the folders by klicking "here"

Code: Select all
Saved Signatures Folder doesn't exist
It is required when "Save Image Mode" is turned on
Click HERE to try to create [/home/exiled/www/roster/addons/siggen/../../../signatures/]
Save Image functions are temporarily disabled


I klicked and got the error as I said in the first post. The real problem I I cannot alter the save path now o.O it's stuck on the ../../signatures. Everytime I "Save Settings" I get the same error and I have no chance to type a new save path using the http-docs. My question would be:

Can I manually change the save path in some config-file in the directory of this addon?

(sorry if I was unclear the first time and thnx for the new code, in fact, that was something really usefull since id like to access the images under my roster with a simpel address xD )
User avatar
Bisa
WR.net Apprentice
WR.net Apprentice
 
Posts: 9
Joined: Thu Jul 20, 2006 11:42 pm
Location: Sweden

Misstyped Save Path

Postby zanix » Sat Jul 22, 2006 2:40 pm

Oh, ok

You have two options
Use the reset to defaults option in siggen config
Or
If you know how to use phpmyadmin, go to the roster_addon_siggen table, and edit the column named "save_images_dir"
Last edited by zanix on Sat Jul 22, 2006 2:41 pm, edited 1 time in total.
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: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Misstyped Save Path

Postby Bisa » Sat Jul 22, 2006 3:03 pm

the reset does not work that way i think, Its jut to reset the changes you have done since you pressed Save settings last time. but If it were to reset to the default settings it does not work for me :/

ill go for the phpmyadmin ^^
thnx for the help m8 :)
User avatar
Bisa
WR.net Apprentice
WR.net Apprentice
 
Posts: 9
Joined: Thu Jul 20, 2006 11:42 pm
Location: Sweden

Misstyped Save Path

Postby zanix » Sun Jul 23, 2006 12:50 am

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: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Misstyped Save Path

Postby Bisa » Sun Jul 23, 2006 5:38 am

bah ^^ where di u find that option :bigsmurf:
User avatar
Bisa
WR.net Apprentice
WR.net Apprentice
 
Posts: 9
Joined: Thu Jul 20, 2006 11:42 pm
Location: Sweden

Misstyped Save Path

Postby zanix » Sun Jul 23, 2006 5:48 am

Along the right side of the page in SigGen Config
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: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Misstyped Save Path

Postby Bisa » Sun Jul 23, 2006 2:35 pm

aight, I fond it, and the problem is sorted (did it with phpmyadmin) so all that is left is thanking you for all the help I got.. and see you next time soemthing is out of my knowledge base :pirate:
User avatar
Bisa
WR.net Apprentice
WR.net Apprentice
 
Posts: 9
Joined: Thu Jul 20, 2006 11:42 pm
Location: Sweden


Return to SigGen

Who is online

Users browsing this forum: No registered users and 1 guest

cron