Benutzername    Passwort    Autologin    
  Passwort vergessen       Registrieren  
beeForum Foren-übersicht » hal9000 » mod support
Neues Thema eröffnen   Dieses Thema ist gesperrt, du kannst keine Beiträge editieren oder beantworten. Hervorhebung entfernen


UploadPic FAQ (english)
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
boris



Beiträge: 9689

Titel: UploadPic FAQ (english)
Verfasst am: Sa, 10 Dez 2005, 19:01
Beitrag
Antworten mit Zitat

UploadPic FAQ
Frequently Asked Questions



Notes:
  • The latest version of UploadPic is always available here, please make sure to install the most recent version - maybe your problem is already known and fixed in an update.

  • If an error and/or a problem occurs that can't be answered by this FAQ, please write a bugreport that is as precise as it can possibly be (what I did, when, where and how). Include the versions of PHP, phpBB and UploadPic and the configuration (browser, server, etc.) your are using. If possible, try a different configuration and check, if the error still occurs. Besides that I recommend the following articles: How to Report Bugs Effectively and How To Ask Questions The Smart Way



I. Error messages

I. 1.
Error message: "SQL Error : 1054 Unknown column 'user_allow_uploadpic' in 'field list'"


You didn't execute the SQL-query from the UploadPic-docfile.
Starting with UploadPic v1.1.2 (see here) this task will be executed by the install-script.

I. 2.
Error message: "Warning: dir( (...) userpix/): failed to open dir: No such file or directory"


1. possible error: You didn't create the picture-directory.
Starting with UploadPic v1.1.2 (see here) this task will be executed by the install-script.

2. possible error: phpBB's script-path is not correct, starting with version 1.1.3 (here), UploadPic contains a fix for this problem.

I. 3.
Error message: "Config not found. Please execute the install-script."


UploadPic is installed, but the install-script (/install/install_uploadpic.php) was not executed to install the necessary changes to database and filesystem.

I. 4.
Error message: "GD-Library not available."


The GD-Library has to be installed for UploadPic's graphic functions to work correctly.
If you can't install the library yourself, your server-administrator can do it.

I. 5.
Error message: "The datatype image/x-citrix-pjpeg is not supported.", even though this datatype is in the list of allowed datatypes.


The datatype "x-citrix-pjpeg" (and other exotic JPG-types, if there are an), can be added by changing the file uploadpic.php as follows (Code-Box): click. Starting from UploadPic's version 1.1.3, this fix is included.

I. 6.
Error message: "Warning: ob_start(): output handler 'ob_gzhandler' cannot be used twice in (...) /admin/page_header_admin.php on line 44"


Can accur in older versions of phpBB and only if GZIP-compression is activated.
Cure: switch off GZIP or download the newest version of UploadPic here.

I. 7.
Error message: "Warning: main(): Unable to access ./../extension.inc in (...) /admin/mods/MOD_UploadPic_1_1_3/install/install_uploadpic.php on line 28"


You have to execute the file /install/install_uploadpic.php, which was copied to the root-directory (manually or using EasyMOD) during the installation (don't execute the file install_uploadpic.php in the EasyMOD-directory). (also see II.1.)

I. 8.
Error message: "Fatal error: Call to undefined function: imagerotate() in (...) /uploadpic.php" when a picture is to be rotated.


The function "imagerotate" is available starting with PHP-version 4.3.0 (see here).
To get the function working, a newer version of PHP needs to be installed on the server.
Starting with UploadPic's version 1.2.0 (here) the rotate-option will not be displayed if the function doesn't exist.

I. 9.
Error message: "Please login." when calling the UploadPic-window even though the user is logged in and has permission to upload.


This problem will only occur with a special kind of session-management, that needs the session-ID in every URL.
Starting with UploadPic's version 1.1.3 (here) this error is fixed.

I. 10.
Error message: "Fatal error: imagecreatetruecolor(): requires GD 2.0 or later"


The version of the installed GD-libraray doesn't support a function that UploadPic needs to perform certain graphic tasks.
A newer version of the GD-library has to be installed with PHP.
If you can't install the library yourself, your server-administrator can do it.
If you're sure to have the correct version of the GD-library, it could be a problem with your webspace-provider. There are known problems with UploadPic (and other programs that use those functions) with the provider "Strato". In this case check, if you can install the forum with another provider or if the support-team of your provider can help you with the problem.

I. 11.
Error message: "Warning: imagejpeg(): Unable to access (...) Warning: imagejpeg(): Invalid filename (...)"


This bug (in PHP!) occurs when using the function imagejpeg with PHP 4.4.1. Starting from version 1.2.0 (here) UploadPic contains a fix for this problem.

I. 12.
Error Message: "Fatal error: Allowed memory size of (...) bytes exhausted (tried to allocate (...) bytes)"
or "Image could not be created. Try uploading a smaller picture."
or browser quits with "white page"


There's not enough memory available for PHP. To use the graphic functions of the GD-library (e.g. rotating and/or resizing pictures with UploadPic), the pictures have to be loaded into the memory completely. As JPG is a compressed format, the uncompressed picture can be a lot bigger than the filesize and exceed the available memory. (Unfortunately PHP can't check what the uncompressed filesize will be before the file is loaded.)
To reserve more memory, the value memory_limit in the file php.ini has to be changed - this change can be done by the server's administrator.
You should also try to reduce the allowed image dimensions in UploadPic as the resized "smaller" image may also be too big for the allowed memory, so the error could already be produced at that point.
Starting from UploadPic version 1.2.0 the above error message is displayed that will tell the user to upload a smaller image (but only, if the server did not cancel the script due to memory problems before).

I. 13.
Error message: "Warning: mysql_free_result(): (...) is not a valid MySQL result resource in (...)"


This error message only occurs when using SQL4. The memory, allocated by a database-operation can not be freed.
In any file, that's causing this message, the following lines can be removed safely:

Code:
$db->sql_freeresult($result);

The won't occur after this modification - UploadPic's functions will work as normal. Starting with UploadPic's version 1.2.0 these lines will be removed completely.

I. 14.
Error message: "Warning: dir(): open_basedir restriction in effect. File (...) is not within the allowed path(s)"


The script_path-variable is not correct and/or the forum is installed in a virtual directory (e.g. a user-directory - the name usually starts with a tilde - the physical path is not identical to the path displayed in the browser in that case).
UploadPic's version 1.2.1 (here) fixes all known path-problems.
If this error occurs with the functions "getimagesize", "filesize", "move-uploaded-file" and/or "filemtime", server-restrictions that prevent file-upload are in effect. Those limits can only be removed by the server-administrator.

I. 15.
Error message: "Image could not be uploaded."


A critical error occured while uploading the image: the filetype could not be verified, obviously it is not a valid image-file.

I. 16.
Error message: "Image too big. A GIF-image must not be larger than XXxYY pixels in size."


Your PHP-version does not support the function imagecreatefromgif so only GIF-files that are smaller than your limits for the picture-dimensions can be uploaded. You can set higher limits in the ACP to remove this error - however, if you set them too high, you may break your forum's layout with large pictures or get the error described at I. 12.

I. 17.
Error message: "Filesize exceeds limit."


The uploaded picture is too big (either the filesize is just too larg or the picture is still to big after resizing and/or rotating). Change the filesize-limit in the UploadPic-config to fix this.

I. 18.
Error message: "imagecreatetruecolor(): Invalid image dimensions"


You have set the value(s) for "max width/height of picture" and/or "max. picsize (kByte) after conversion" to 0 in the ACP.

I. 19.
Error message: "Please make sure the install and contrib directories are deleted"
or: I can't execute the install-script


This is how it works:
1. do not disable your board
2. log in on your admin-account
3. upload the install-directory
4. call the install-script with your browser, something like this: yourdomain.com/yourforumpath/install/install_uploadpic.php

I. 20.
Error message: "Image could not be uploaded. DEBUG MODE Line : xxx File : uploadpic.php"


Either the uploaded file is broken or (more likely) the server-configuration doesn't allow uploads. Most of the time the avatar-upload will also not work in your forum, if you get this error. The necessary changes (don't ask me about them) have to be changed by the server-administrator.
If the avatar-upload works it could help to delete the userpix-directory, create a new one and set the correct permissions again.

I. 21.
Error message: "safe mode restriction in effect"


If you get this, a server-setting is preventing the upload (or another functin of UploadPic). The setting has to be changed on the server by a server-admin (don't ask me how).


II. Problems

II. 1.
Where do I have to put the file "install_upload.php" ?


As stated in the MOD-documentation:
the documentation gab folgendes von sich:
copy install/*.* to install/*.*

So if your forum is here:
yourdomain.com/forum/
the install-script that you'll have to execute after installing the MOD is here:
yourdomain.com/forum/install/install_uploadpic.php
After executing the script, you must delete the install-directory, otherwise phpBB will refuse to run.

II. 2.
I can't see the link for uploading pictures anywhere ?!


Possible errors:
1. The user is guest.
2. The logged in user doesn't have the permission to upload.
3. UploadPic wasn't implemented correctly. Most errors occur while changing the file posting_body.tpl.
4. UploadPic was not installed in the language you're using. The main install-file only contains changes in english, you will have to install other languages manually - you can find translated files in the directory "translations/".
5. UploadPic was not installed for all templates. (also see II. 9.)
6. In the template you're using, the UploadPic-switch is inside another switch. The "outer" switch should be closed directly before the UploadPic-switch and re-opened again afterwards. (This is not a "clean" solution as the UploadPic-link could be displayed when it should not, but there no other possibility to solve this issue.)

II. 3.
Pictures can be uploaded (no error message) but won't show.

or: Error message: "Image-directory is not writable."

Possible solution: The PHP-function "chmod" that will change file- and directory-permissions won't work on Windows-servers, so you will have to set the permission manually. (How ? Via FTP or directly on the server - Google knows more.)
The "userpix"-directory has to be writeable for all users (Windows-rights: "rwxrwxrwx", equivalent to Unix-rights: "0777"), so pictures can be saved on the server.
An explanation of "chmod" is here.
You can find instructions on how to change permissions with some of the most popular FTP-programs here.

II. 4.
The [img=left/right] doesn't work for me!


You will have to install the mod "Left and Right IMG tags", download here, support here. And, to get that running, you will nee the "Multi Quick BBCode Mod", more information via the left/right-support-link.
Alternative: switch off "left/right" in the UploadPic-configuration.

II. 5.
I have NO idea how to install MODs


For general help on how to install MODs in phpBB see here, for instructions on how to use phpMyAdmin see here.
Alternative: use EasyMOD (download here) for the installation.

II. 6.
No picture but only [img]path/picname.jpg[/img] is displayed in the message.


As the BBCode-tag [img] is used, the user has to active BBCode for the message in which the picture should be displayed.

II. 7.
Changes in the usereditor (user defaults) in the ACP are not saved anymore.


This bug will only occur if you installed an early release of UploadPic v1.1.2 with EasyMOD (not updating from 1.0.0).
The problem is a bug in the install-statement which will be executed correctly if done manually but will producte the error when using EasyMOD. This bug is fixed in UploadPic's version 1.1.3 (here).

II. 8.
UploadPic won't work with the "Junior Admin MOD" (Junior admins can't set permissions for users).


It'll work with UploadPic's version 1.1.3. (see here)

II. 9.
I'm using a different template than subSilver and can't find the part where to insert the UploadPic-code.


There are hundreds (if not thousands) of different templates for phpBB - a MOD can never be build to work with all templates. All MODs (and EasyMOD) are designed to work with the standard-template "subSilver" only.
Basically the new lines can be put anywhere you like as long as they're there and does not cause erros in the HTML-Code of the template.
As it's impossible to know all templates, I cannot grant any support for problems with templates different to subSilver - whoever wants to apply a MOD to his forum with different than the standard template should know enough HTML to change the files of the other templates correctly.

For alle templates other than subSilver (or the subSilver-Template which has been changed by another MOD so you can't find the bit you're supposed to replace), the following code has to be placed in the file posting_body.tpl at a position where you want the UploadPic-link to appear:

Code:
               <!-- BEGIN switch_uploadpic -->
               <strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=450');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a>&nbsp;<br /></strong>
               <!-- END switch_uploadpic -->

It is important that the code starts and ends with a new line. So you place your cursor at the position where you want the UploadPic-code to be placed, insert a new line (before "<!-- BEGIN switch_uploadpic ..."), copy the code into the page and insert another line (after "... END switch_uploadpic -->").

II. 10.
I'd like to change the default-value for the upload-permission after I installed UploadPic.


This change has to be done in the database directly - the following code will set the default to "yes" (permission for all new users):
Code:
ALTER TABLE `phpbb_users` CHANGE `user_allow_uploadpic` `user_allow_uploadpic` TINYINT( 4 ) DEFAULT '1' NOT NULL

this code sets the default-value to "no":
Code:
ALTER TABLE `phpbb_users` CHANGE `user_allow_uploadpic` `user_allow_uploadpic` TINYINT( 4 ) DEFAULT '0' NOT NULL

The best way to perform this change is phpMyAdmin (documentation here).
(Of course, you'll have to change "phpbb_" to your table-prefix if you set it to something else when you installed phpBB.)

II. 11.
Didn't the documentation say something about a function to rotate the uploaded pictures with ?


If your PHP-version does not support the function imagerotate, this option will automatically be hidden.
Also see I. 8.

II. 12.
How can I use the BMP-format (bitmap) with UploadPic?


You can't.
PHP doesn't support the direct loading of BMP-files. To load BMP-files, you'd have to program your own functions. Those functions do exist (e.g. here), but they're quite big (not counting the effort to rework them and make them fit into UploadPic), so they would probably double UploadPic in size. As BMP-files are hardly ever used, I guess it's not worth the time to include it with UploadPic.

II. 13.
How can I use UploadPic, to upload movie-files (avi, mpeg, mov)?


It's not possible to include .avi-format (or any other movie-format), as the BBCode-[img]-tag that's used to display the "images" uses the HTML-<img>-tag which doesn't support movie-files. So even if you could upload a movie with UploadPic, your message would look something like this: [img]test.avi[/img] without showing the movie or making it downloadable.
To include a movie (or any other file) into messages, the movie-file has to be treated like a "normal" file (not a picture-file) - to do that, you can use the Upload-MOD or the Attachment-MOD, but not UploadPic (otherwise it would be called "UploadAnyFile" big grin). What both of the mentioned MODs still do not do, is display a thumbnail of the uploaded movie.

II. 14.
Where did my information go that was display before the upload ? (starting with version 1.2.6)


The information was moved to the language files to ensure multi language support and remove the limitation of 255 characters for the text.
To get the text back, it has to be put in the language files:

Code:
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
$lang['UP_Information'] = "";

You can enter any text between the quotes and it will be displayed before the upload. If you want the text to appear in other languages, you'll have to change the according files (e.g. "language/lang_german/lang_main.php") as well.

II. 15.
I can't find any menu-items in the ACP


After you uploaded the necessary files (all files from the "admin"-directory) UploadPic's menu-items will appear automatically.

II. 16.
Uploading animated GIFs does not work?


The upload of animated GIFs only works, if the file dimensions do not exceed the maximum (set in the ACP). If the animation has to be resized by UploadPic, it is saved as a JPG-file and will not be animated any more. Also adding a watermark to the picture (and therefore changing it) will result in a JPG and not an (animated) GIF.

II. 17.
My userpix-directory is "full", the checking for unused pictures takes forever.


You can just create a new directory, e.g. "userpix2" - change the permission of the directory to "777". The new name has to be entered in the database, table phpbb_config, variable uploadpic_picdir, you can do this using phpMyAdmin. You will get a "fresh" directory without any files this way, all other uploaded pictures (and their path) will remain unchanged.
Note: UploadPic will not check for unused pictures in the old directory !

II. 18.
I can't read what's on the buttons (e.g. black letters on black ground). (Sometimes happens when using dark templates.)


Here's the cure. Starting with UploadPic version 1.3.3 those changes are implemented (in a fresh install).

II. 19.
The "uploading"-repeats over and over but does not show the real upload-progress.


That's correct. A real progress-display is not possible with PHP only.

II. 20.
The "uploading"-image is not display (correctly) in some browsers.


The "modal popup" that contains the "uploading"-image uses CSS and JavaScript. Either the browser is not the latest version, doesn't support the necessary functions or the user disabled JavaScript. In any case it's a client-problem, not a bug in UploadPic.
If the picture does not show in any browser, check if you uploaded up_uploading.gif (for all languages and templates !) correctly.

II. 21.
I don't want the "uploading"-image to be displayed.


Just delete the image from the server.

II. 22.
I deactivated UploadPic for a couple of forums, but users can still use pictures in those forums.


Correct. Only the UploadPic-button is hidden in those forums. see III. 1.

II. 23.
How can I change the number of pictures per page shown in the gallery?


The number of pictures is identical with the value for "uploadpic_latest" (= "Number of latest uploads to view in the ACP").


III. Features

III. 1.
How about a function to switch permission for UploadPic for each board separately?


Even if UploadPic is not allowed for a single board, the users could upload pictures in another Board, copy the Code and use it in the "forbidden" board.
A feature like this would have to dig deep in the phpBB-code and create a configuration for each board to allow/disallow the [img]-tag generally. This functions goes way beyond UploadPic and should be realised in a separate MOD.

III. 2.
I want to upload pictures and view them in al smaller size. Clicking the picture should open a window with the full size.


There are MODs that already do this, e.g. simple image resize will resize all images that are too big (maximum size can be set in simple image resize, clicking the picture will open a popup-window with the original-sized picture. UploadPic can still be used to upload pictures. Download simple image resize here.

III. 3.
Why is the UploadPic-link an image now? (was: I'd like to replace the UploadPic-link with a button.)


Starting with UploadPic's version 1.3.0 the UploadPic-link was replaced by an image that looks like a button. This is to ensure that the UploadPic-window will open even if the user has disabled JavaScript (this is not possible with a "real" button). And the button can be any image now so it doesn't even have to look like a button.
If you'd like to use the old UploadPic-link instead, just delete the image (templates/subSilver/images/lang_english/up_button.gif).

I want the button anyways !

Code:
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------
# Note: newer versions (>= 1.3.0)
#
               <strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=470');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a></strong><br />

#
#-----[ FIND ]------------------------------------------
# Note: older versions (< 1.3.0)
#
               <strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=470');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a>&nbsp;<br /></strong>

#
#-----[ REPLACE WITH ]------------------------------------------
#
               <input type="button" class="button" name="uploadpic" value="{L_UPLOADPIC}" onClick="window.open('{S_UPLOADPIC}', '_uploadpic', 'HEIGHT=400,resizable=yes,scrollbars=yes,WIDTH=450');return false;" onMouseOver="helpline('up')" /><br />

As stated before: for users without JavaScript the "real" button won't work and to use the button the button-picture (see above) must be deleted !

III. 4.
How can I change the size of the popup-window?


Code:
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------
#
               <strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'HEIGHT=400,resizable=yes,scrollbars=yes,WIDTH=450');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a>&nbsp;<br /></strong>

The numbers behind "HEIGHT=" and "WIDTH=" in this line (here: 400 and 450) determine the height and width of the popup-window. Adjusting those values will change the window-size.

III. 5.
I want to use UploadPic with the "Quick Reply MOD" or use UploadPic to insert the [img]-Code into an input-field other than the message.


To do this, UploadPic (starting from version 1.2.5) has to be called with the variable "inputname" which contains the name of the input-field that the code should be inserted in. E.g. the name of this field in the "Quick Reply MOD" ist "input". The name must not contain special characters, spaces and/oder punctuation !
(If you want to use UploadPic with the signature in the user profile, use this modification, you'll need version 1.3.1a or higher.)

Here's the code that has to be fit individually into whatever MOD you're using ("NAME_OF_INPUT_FIELD" has to be replaced with the correct name of the input field, "NAME_OF_FORM" with the correct name of the form, etc.). Scroll down for the code for the "Quick Reply MOD":
Code:
to be inserted BEFORE the template-variables ("$template->assign_vars(array(..."):

// create switch for UploadPic
if ($board_config['uploadpic_disabled'] != 1)
{
   if (($userdata['user_allow_uploadpic'] == 1) && ($userdata['user_posts'] >= intval($board_config['uploadpic_minposts'])))
   {
      $template->assign_block_vars('switch_uploadpic', array());
   }
}

to be inserted IN the template-variables:

   'S_UPLOADPIC' => append_sid('uploadpic.'.$phpEx.'?inputname=NAME_OF_INPUT_FIELD&formname=   NAME_OF_FORM'),
   'L_UPLOADPIC' => (file_exists($images['uploadpic_button'])) ? '<img src="'.$images['uploadpic_button'].'" name="upbutton" alt="'.$lang['UploadPic'].'" title="'.$lang['UploadPic'].'" border="0">' : $lang['UploadPic'],
   'L_UPHELP' => $lang['UP_Help'],

to be inserted in the template that the MOD is calling:

               <!-- BEGIN switch_uploadpic -->
               <strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=470');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a>&nbsp;<br /></strong>
               <!-- END switch_uploadpic -->

As the "Quick Reply MOD" doesn't use the MOD-requirements and generates the whole HTML-Code outside the template-file, the following code has to be used in this case (used in the inserted code in the file viewtopic.php):

Code:
#
#-----[ FIND ]------------------------------------------
# NOTE: the line is much longer
#
   $quick_reply_form .= "<textarea

#
#-----[ BEFORE, ADD ]------------------------------------------
#
   // MOD UploadPic - begin
   if ($userdata['user_allow_uploadpic'] == 1)
   {
      $quick_reply_form .= "<strong><a href=\"".append_sid('uploadpic.'.$phpEx.'?inputname=input')."\" onclick=\"window.open('".append_sid('uploadpic.'.$phpEx.'?inputname=input')."', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=470');return false;\" target=\"_uploadpic\" class=\"nav\" onMouseOver=\"helpline('up')\">".$lang['UploadPic']."</a>&nbsp;<br /></strong>";
   }
   // MOD UploadPic - end

I can't and will not grant any support other than supplying the above code for the use of UploadPic with other MODs. As other MODs are always subject to change that's beyond my control (or knowledge - I don't even use the "Quick Reply MOD" myself), the above code should be tested and handled with care as it may not work with any other code just like that. Anybody who wants to use UploadPic for other MODs and/or input-fields, should know exactly what he's doing, should be able to attach and change the code on his own and - most of all - do all this at his own risk !

III. 6.
How can I enter more than 255 characters for the information-text which is displayed before the upload?


Starting with UploadPic's version 1.2.6 the information is stored in the language-files and can hold as many characters as you need. The entry "uploadpic_information" can be deleted from the phpBB-database (table "phpbb_config") as it is not used any more.

III. 7.
How can I use UploadPic with the "Knowledge Base"?


Execute this code to change the necessary Knowledge Base-files:
Code:
#
#-----[ OPEN ]------------------------------------------
#
includes/kb_post.php

#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars( array(
      'S_ACTION' => $kb_action_url,

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// create switch for UploadPic
if ($board_config['uploadpic_disabled'] != 1)
{
   if (($userdata['user_allow_uploadpic'] == 1) && ($userdata['user_posts'] >= intval($board_config['uploadpic_minposts'])))
   {
      $template->assign_block_vars('switch_uploadpic', array());
   }
}

#
#-----[ FIND ]------------------------------------------
#
      'L_FONT_HUGE' => $lang['font_huge'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
      // MOD UploadPic - begin
      'S_UPLOADPIC' => append_sid('uploadpic.'.$phpEx),
      'L_UPLOADPIC' => (file_exists($images['uploadpic_button'])) ? '<img src="'.$images['uploadpic_button'].'" name="upbutton" alt="'.$lang['UploadPic'].'" title="'.$lang['UploadPic'].'" border="0">' : $lang['UploadPic'],
      'L_UPHELP' => $lang['UP_Help'],
      // MOD UploadPic - end

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/kb_post_body.tpl

#
#-----[ FIND ]------------------------------------------
#
f_help = "{L_BBCODE_F_HELP}";

#
#-----[ AFTER, ADD ]------------------------------------------
#
// MOD UploadPic - begin
up_help = "{L_UPHELP}";
// MOD UploadPic - end

#
#-----[ FIND ]------------------------------------------
#
            <!-- END switch_bbcodes -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
         <!-- BEGIN switch_uploadpic -->
         <tr><td colspan="9" align="right"><strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=450');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a>&nbsp;</strong></td></tr>   
         <!-- END switch_uploadpic -->

(The support-note from chapter III. 5. also applies to this code.)

If you used different table names for the Knowledge Base-tables in the database (which are set automatically on install), you will have to change the name in the file includes/uploadpic_functions.php (in this line: FROM ".$table_prefix."kb_articles).

III. 8.
How do I use the value "uploadpic_forcepath"?


The "forcepath"-value changes the HTTP-path for uploaded pictures in the database. The value will replace the normal path, which is put together using the forumdata (e.g. myforum.de/userpix/) with another one (e.g. yourforum.de/pictures/).
This value can not be used to upload pictures to another server !! This function is not offered by UploadPic. (Not yet - maybe never, as to every single access to a file there has to be an aquivalent with FTP-functions which is a huge effort.)
This means that the pictures will remain in the exact same physical location as before, no picture will be moved, uploaded somewhere else or changed in any way - the only difference is, that the access to the picture with a browser is done using a different URL.

Caution: The "forcepath"-value should not be used for trying to solve upload-problems. If your configuration does not meet very special requirements, the use of this value will do more damage than good. If you encounter problems with uploading and/or paths, your whould check all other chapters of the FAQ to fix the problem. 99,9% of UploadPic-useres will not have to use this value !

Who can/should/mus use the value ?
- Forums that are hosted on domains with the domainname in the forum-config, but are reachable via a different address on the web (e.g. via domain-forwarding).
E.g.: The value of server_name is "stupidforum.de" in the databse, script_path is "/forum/" and uploadpic_picdir is "/forum/userpix/", but the forum itself (and all forum-files) is reached via "superforum.de/phpbb/". In this case, the "forcepath"-value can be changed, so the pictures can be found under the correct (= changed) address.
- Forums, that a running in a local network and are rechable via (e.g.) dyndns.org, so their IP-address changes all the time. With those forums, UploadPic would always write the momentary IP-address to the database which may be invalid a minute later. The "forcepath"-value can help here. The value should be put in your hosts-file and redirected to your local server (more information here), to enable the browser to find the pictures.

What value is to be entered ?
The complete URL of your userpix-directory including protocol, port and slashes, e.g. "http://" (or "https://") followed by the subdomain, the complete domain name, the port ("80" is standard and doesn't have to be specified), the path to the userpix-directory and a slash. So a valid address for the "forcepath"-value would be "http://www.beehave.de/forum/userpix/".
As the value has to be valid and reachable, you should check the value thoroughly before using it, as the config of UploadPic does no checking for syntax, accessability, etc. !!

Again: the usage of the "forcepath"-value is only for people who definitely need it and know what they are doing ! I take no responsibility nor will I offer support for the using of this value and problems that may occur of it !

III. 9.
Is it possible to view pictures only after they are approved (by admin/moderator)?


No. To do that all pictures have to be saved in the database and UploadPic would have to be restructured completely. The problem ist, that the pictures are shown after the upload. To keep users from just copying the link and using it, the uploaded pictures would have to be replaced after "inserting" them into the message and saved under a crypted link to be approved.
The function "UploadPic recent" in the version 1.3.0 offers another, similar solution to delete or censor unappropriate pictures.

III. 10.
How can I change the path to the userpix-directory?


The path should not be changed once UploadPic is installed (even more so if pictures have been uploaded) - if you have to change the path (or don't want your old pictures listed in UploadPic), the following instructions may be helpful:
1. The path has to be changed in the database. You can find it in the table phpbb_config, the name of the value is uploadpic_picdir.
2. The new directory has to be created and changed to chmod 777

If you don't need UploadPic to maintain your old pictures (they will stay visible in the posts they've been uploaded to), the change is done here. If you want the pictures, that have been uploaded so far, to appear in UploadPic (to use UploadPic's functions on them), you'll have to perform the following steps as well.

3. Already uploaded pictures have to be moved (and also set to 777).
4. All posts, PMs and avatars that already contain pictures with the old path, have to be changed to the new one. To do this, the following queries have to be executed (Caution: no guarantee, backup your database before doing this !!)

Code:
UPDATE phpbb_posts_text SET posts_text = REPLACE(posts_text, 'oldurl', 'newurl');
UPDATE phpbb_privmsgs_text SET privmsgs_text = REPLACE(privmsgs_text, 'oldurl', 'newurl');
UPDATE phpbb_users SET user_avatar = REPLACE(user_avatar, 'oldurl', 'newurl');

You'll have to replace 'oldurl' with the complete HTTP-path to your old userpix-directory (e.g. 'http://www.mydomain.de/myforum/userpix/') and 'newurl' with the complete new path. If you use a different prefix than "phpbb_", you'll also have to change the table names.

Caution: If you desperately want to change the path, you should know how to use phpMyAdmin and know how to change file permission. Changing paths in the database globally is a pretty tricky thing, too, so the queries above are executed at your risk - I won't offer any support about this issue beyond these hints !

III. 11.
How can I use UploadPic with "easyCMS"?


Execute this code to change the necessary files:
Code:
#
#-----[ OPEN ]------------------------------------------
#
cms_post_article.php

#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
   'USERNAME' => $username,

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// create switch for UploadPic
if ($board_config['uploadpic_disabled'] != 1)
{
   if (($userdata['user_allow_uploadpic'] == 1) && ($userdata['user_posts'] >= intval($board_config['uploadpic_minposts'])))
   {
      $template->assign_block_vars('switch_uploadpic', array());
   }
}

#
#-----[ FIND ]------------------------------------------
#
      'L_FONT_HUGE' => $lang['font_huge'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
   // MOD UploadPic - begin
   'S_UPLOADPIC' => append_sid('uploadpic.'.$phpEx),
   'L_UPLOADPIC' => (file_exists($images['uploadpic_button'])) ? '<img src="'.$images['uploadpic_button'].'" name="upbutton" alt="'.$lang['UploadPic'].'" title="'.$lang['UploadPic'].'" border="0">' : $lang['UploadPic'],
   'L_UPHELP' => $lang['UP_Help'],
   // MOD UploadPic - end

#
#-----[ OPEN ]------------------------------------------
#
cms_post_comment.php

#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
   'USERNAME' => $username,

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// create switch for UploadPic
if ($board_config['uploadpic_disabled'] != 1)
{
   if (($userdata['user_allow_uploadpic'] == 1) && ($userdata['user_posts'] >= intval($board_config['uploadpic_minposts'])))
   {
      $template->assign_block_vars('switch_uploadpic', array());
   }
}

#
#-----[ FIND ]------------------------------------------
#
      'L_FONT_HUGE' => $lang['font_huge'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
   // MOD UploadPic - begin
   'S_UPLOADPIC' => append_sid('uploadpic.'.$phpEx),
   'L_UPLOADPIC' => (file_exists($images['uploadpic_button'])) ? '<img src="'.$images['uploadpic_button'].'" name="upbutton" alt="'.$lang['UploadPic'].'" title="'.$lang['UploadPic'].'" border="0">' : $lang['UploadPic'],
   'L_UPHELP' => $lang['UP_Help'],
   // MOD UploadPic - end

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/cms_article_posting_body.tpl

#
#-----[ FIND ]------------------------------------------
#
f_help = "{L_BBCODE_F_HELP}";

#
#-----[ AFTER, ADD ]------------------------------------------
#
// MOD UploadPic - begin
up_help = "{L_UPHELP}";
// MOD UploadPic - end

#
#-----[ FIND ]------------------------------------------
#
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
              <td nowrap="nowrap" align="right">
               <!-- BEGIN switch_uploadpic -->
               <strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=450');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a></strong><br />
               <!-- END switch_uploadpic -->
               <span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/cms_comment_posting_body.tpl

#
#-----[ FIND ]------------------------------------------
#
f_help = "{L_BBCODE_F_HELP}";

#
#-----[ AFTER, ADD ]------------------------------------------
#
// MOD UploadPic - begin
up_help = "{L_UPHELP}";
// MOD UploadPic - end

#
#-----[ FIND ]------------------------------------------
#
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
              <td nowrap="nowrap" align="right">
               <!-- BEGIN switch_uploadpic -->
               <strong><a href="{S_UPLOADPIC}" onclick="window.open('{S_UPLOADPIC}', '_uploadpic', 'height=400,resizable=yes,scrollbars=yes,width=450');return false;" target="_uploadpic" class="nav" onMouseOver="helpline('up')">{L_UPLOADPIC}</a></strong><br />
               <!-- END switch_uploadpic -->
               <span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>

(The support-note from chapter III. 5. also applies to this code.)

If you used different table names for easyCMS in the database (which are set automatically on install), you will have to change the name in the file includes/uploadpic_functions.php (in this line: FROM ".$table_prefix."cms_articles_text).

III. 12.
How can I use UploadPic with the "Lexicon MOD"?


Basically by executing the code from chapter III. 5. (minimal and obvious changes). You also have to change a switch so the UploadPic-switch is not inside another one, see here and here. To make the paths work (the "Lexicon MOD" will call UploadPic from the admin-directory), you'll have to make this change.

III. 13.
Is it possible to upload pictures to another (remote) server?


No, and this feature will not be added.
The reason: each function that accesses the uploaded pictures would have to be programmed in two versions - one for the local, the other (the "FTP-version") for the remote pictures, and I won't have time for this massive effort.
Another obstacle making this feature impossible (especially for me): only very few PHP-installations are compiled with the necessary FTP-functions compiled. So just a couple of people would be able to even use the remote-functions (not including myself).


IV. Miscellaneous

IV. 1.
Didn't you have an archive for download with all necessary files already "modded" for UploadPic ?


Yes, but I removed the archive, because the folks that needed those files usually didn't have the right versions of phpBB and then where as lost as before, etc. etc.
The motto is: if you cannot modify your forum on your own, use EasyMOD (here), get professional help (there are people who do this for a living) or leave it.

IV. 2.
How does PHP know who uploaded what picture?


The picture filename is preceeded by the user-id on saving: USERID_picturename.jpg

IV. 3.
What do the numbers mean that are attached to the filename?


The first number ist the user-id (see above), the number that follows the filename is a counter that increases with every upload if you enabled the option "make unique filenames" to prevent pictures with the same filename from being overwritten.

IV. 4.
What is the maximum size for the watermark-picture and what filetypes are supported?


There's no maximum, but I'd prefer it only as big as necessary and as small as possible.
Allowed datatypes are JPG / GIF / PNG.

IV. 5.
Where do I find the gallery?


In the upload-window, at the bottom between the buttons "cancel" and "send".

IV. 6.
I have a tremendous idea for a new UploadPic-feature, where can I post it?


There already is a list with ideas for future versions in this board. If your idea is not on it, just start a new thread ! (here)

IV. 7.
What do I have to set my forum-paths to ?


You should set your paths to something like this:
server_name: the name of the domain where the forum is hosted, here "www.beehave.de"
script_path: the forum-directory, here "/forum/"
uploadpic_picdir: the picture-directory for Uploadpic, starting from the domain-root, here "/forum/userpix/"
For further questions I recommend reading the phpBB-documentation..

IV. 8.
I do not know where to put my watermark file.


Anywhere you like - you just have to provide the correct path in the config.
e.g. "images/up_watermark.png" will search for the picture in "yourdomain.de/forumpath/images/" ...
You can't get anything wrong there: if the config finds the picture, it is displayed next to the input field for the filepath/-name in the UploadPic-config.

IV. 9.
When will the next update be available ?


Don't ask.

IV. 10.
How can I ever thank the author of UploadPic for his priceless, altruistic work?


Via PayPal: paypal(at)beehave.de

IV. 11.
Will UploadPic be compatible with phpBB 3.0 (Olympus) ?


Can you play a CD in your VCR ? I guess not.
As phpBB 3.0 will have built-in file-upload functions, UploadPic will probably be obsolete then. A version for phpBB 3.0 is not (yet) planned, especially as I'm not using phpBB 3.0 myself (yet).


____________
beehave - home of humbug ... [we can't afford to be neutral]

Nach oben
Private Nachricht senden Website dieses Benutzers besuchen Rang:robot methusalem 3. platz professioneller Sportangler Profi-Winzer (7x Hamm) Arcade-Meister, Rang 16 rainbow-cup
Beiträge der letzten Zeit anzeigen:   
Neues Thema eröffnen   Dieses Thema ist gesperrt, du kannst keine Beiträge editieren oder beantworten.    beeForum Foren-übersicht » hal9000 » mod support Seite 1 von 1
Gehe zu:  



ähnliche Beiträge
Thema Autor Forum Antworten Verfasst am
Keine neuen Beiträge uploadpic auf orion phpBB instalieren hewika mod support 9 Mo, 03 Jan 2011, 21:18 Letzten Beitrag anzeigen
Keine neuen Beiträge uploadpic Problem -> hilfe benötigt Dakota mod support 1 So, 15 Aug 2010, 15:39 Letzten Beitrag anzeigen
Keine neuen Beiträge Film: Johnny English boris zelluloid 0 Sa, 05 Sep 2009, 20:41 Letzten Beitrag anzeigen
Keine neuen Beiträge UploadPic 1.3.7 Imagerotate Morpheus mod support 2 Mo, 08 Sep 2008, 19:41 Letzten Beitrag anzeigen
Keine neuen Beiträge UploadPic 1.3.7 Besitzer ändern Morpheus mod support 2 Mo, 08 Sep 2008, 15:18 Letzten Beitrag anzeigen


Schreiben: nein. Antworten: nein. Bearbeiten: nein. Löschen: nein. Umfragen: nein.
phpBB © phpBB Group | 1699082 Besucher seit 01.01.2016 (heute: 1919) | impressum