Icy Phoenix

     
 


This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 1
 
 
Reply with quote Download Post 
Post FAP CUSTOMIZATION - Is There Such A Thing? 
 
Hi there, I have a wildlife forum room which you can find at gardenwildlife.co.uk Im using phpbb 2.0.22. I have also Smartor Photo Album 2.0.54 installed.

What Im after is this. Im looking for a mod which will allow people to post an image in a topic as well as at the same time the image gets uploaded into that users Personal Galleries. I no you would have to have some kind of image uploaded as well.

Something like this may be?

I saw this on a forum at forum.biggonline.co.uk I did ask the guy who did this but he can’t really help as he has loads of work on at the moment.
image
 



 
JezUK1Send private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
I hope that's help but i don't know whether is only for FAP

Original Posting of Mod:
http://www.mightygorgon.com/viewtop...d+while+posting

Author updates to Mod:
http://www.welsolutions.com/viewtopic.php?t=10
 



 
pepiSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
Hi, Sorry the links you have posted I cant view. It comes up saying Internet Explorer cannot display the webpage. What should I do LOL?
 



 
JezUK1Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
Hi

Ups .... the second link cannot display
but here the mod

Posting_Upload_Mod_001.zip
Description: Image Upload While Posting 
Download
Filename: Posting_Upload_Mod_001.zip
Filesize: 2.39 KB
Downloaded: 148 Time(s)

 



 
pepiSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
Many thanks. So will this do what im after? Do I need FAP TO RUN IT?

 I have just tryed to install it anyway and it comes up with
Critical Error

FIND FAILED: In file [album_upload.php] could not find:

if( isset($HTTP_POST_VARS['user_id']) )

MOD script line #49 :: FAQ :: Report

 I tryed 2 install it useing EasyMod.
 



 
JezUK1Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
look for
Code: [Download] [Hide]
  1. #  
  2. #-----[ OPEN ]------------------------------------------  
  3. #  
  4. album_upload.php  
  5. #  
  6. #-----[ FIND ]------------------------------------------  
  7. #  
  8. if( isset($_POST['user_id']) )  
  9. #  
  10. #-----[ BEFORE, ADD ]------------------------------------------  
  11. #  
  12. // Start ewelin Posting Upload Mod  
  13. if( isset($_POST['mode']) )  
  14. {  
  15.     $mode = intval($_POST['mode']);  
  16. }  
  17. elseif( isset($_GET['mode']) )  
  18. {  
  19.     $mode = intval($_GET['mode']);  


dont use EasyMod
 



 
pepiSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
I canot find it any were in there. See if you can.....

Code: [Download] [Hide]
  1. <?php  
  2. /***************************************************************************  
  3. *                             album_upload.php  
  4. *                            -------------------  
  5. *   begin                : Wednesday, February 05, 2003  
  6. *   copyright            : (C) 2003 Smartor  
  7. *   email                : smartor_xp@hotmail.com  
  8. *  
  9. *   $Id: album_upload.php,v 2.1.2 2003/03/13 19:46:00 ngoctu Exp $  
  10. *  
  11. ***************************************************************************/  
  12.  
  13. /***************************************************************************  
  14. *  
  15. *   This program is free software; you can redistribute it and/or modify  
  16. *   it under the terms of the GNU General Public License as published by  
  17. *   the Free Software Foundation; either version 2 of the License, or  
  18. *   (at your option) any later version.  
  19. *  
  20. ***************************************************************************/  
  21.  
  22. define('IN_PHPBB', true);  
  23. $phpbb_root_path = './';  
  24. $album_root_path = $phpbb_root_path . 'album_mod/';  
  25. include($phpbb_root_path . 'extension.inc');  
  26. include($phpbb_root_path . 'common.'.$phpEx);  
  27. include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);  
  28.  
  29. //  
  30. // Start session management  
  31. //  
  32. $userdata = session_pagestart($user_ip, PAGE_ALBUM);  
  33. init_userprefs($userdata);  
  34. //  
  35. // End session management  
  36. //  
  37.  
  38.  
  39. //  
  40. // Get general album information  
  41. //  
  42. include($album_root_path . 'album_common.'.$phpEx);  
  43.  
  44.  
  45. /*  
  46. +----------------------------------------------------------  
  47. | Common Check  
  48. +----------------------------------------------------------  
  49. */  
  50.  
  51.  
  52. // ------------------------------------  
  53. // Check the request  
  54. // for this Upload script, we prefer POST to GET  
  55. // ------------------------------------  
  56.  
  57. if( isset($HTTP_POST_VARS['cat_id']) )  
  58. {  
  59.     $cat_id = intval($HTTP_POST_VARS['cat_id']);  
  60. }  
  61. else if( isset($HTTP_GET_VARS['cat_id']) )  
  62. {  
  63.     $cat_id = intval($HTTP_GET_VARS['cat_id']);  
  64. }  
  65. else  
  66. {  
  67.     message_die(GENERAL_ERROR, 'No categories specified');  
  68. }  
  69.  
  70.  
  71. // ------------------------------------  
  72. // Get the current Category Info  
  73. // ------------------------------------  
  74.  
  75. if ($cat_id != PERSONAL_GALLERY)  
  76. {  
  77.     $sql = "SELECT c.*, COUNT(p.pic_id) AS count  
  78.             FROM ". ALBUM_CAT_TABLE ." AS c  
  79.                 LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id  
  80.             WHERE c.cat_id = '$cat_id'  
  81.             GROUP BY c.cat_id  
  82.             LIMIT 1";  
  83.     if( !($result = $db->sql_query($sql)) )  
  84.     {  
  85.         message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql);  
  86.     }  
  87.  
  88.     $thiscat = $db->sql_fetchrow($result);  
  89. }  
  90. else  
  91. {  
  92.     $thiscat = init_personal_gallery_cat($user_data['user_id']);  
  93. }  
  94.  
  95. $current_pics = $thiscat['count'];  
  96.  
  97. if (empty($thiscat))  
  98. {  
  99.     message_die(GENERAL_ERROR, $lang['Category_not_exist']);  
  100. }  
  101.  
  102.  
  103. // ------------------------------------  
  104. // Check the permissions  
  105. // ------------------------------------  
  106.  
  107. $album_user_access = album_user_access($cat_id, $thiscat, 0, 1, 0, 0, 0, 0); // UPLOAD  
  108.  
  109. if ($album_user_access['upload'] == 0)  
  110. {  
  111.     if (!$userdata['session_logged_in'])  
  112.     {  
  113.         redirect(append_sid("login.$phpEx?redirect=album_upload.$phpEx?cat_id=$cat_id"));  
  114.     }  
  115.     else  
  116.     {  
  117.         message_die(GENERAL_ERROR, $lang['Not_Authorised']);  
  118.     }  
  119. }  
  120.  
  121.  
  122. /*  
  123. +----------------------------------------------------------  
  124. | Upload Quota Check  
  125. +----------------------------------------------------------  
  126. */  
  127.  
  128. if ($cat_id != PERSONAL_GALLERY)  
  129. {  
  130.     // ------------------------------------  
  131.     // Check Album Configuration Quota  
  132.     // ------------------------------------  
  133.  
  134.     if ($album_config['max_pics'] >= 0)  
  135.     {  
  136.         //  
  137.         // $current_pics was set at "Get the current Category Info"  
  138.         //  
  139.         if( $current_pics >= $album_config['max_pics'] )  
  140.         {  
  141.             message_die(GENERAL_MESSAGE, $lang['Album_reached_quota']);  
  142.         }  
  143.     }  
  144.  
  145.  
  146.     // ------------------------------------  
  147.     // Check User Limit  
  148.     // ------------------------------------  
  149.  
  150.     $check_user_limit = FALSE;  
  151.  
  152.     if( ($userdata['user_level'] != ADMIN) and ($userdata['session_logged_in']) )  
  153.     {  
  154.         if ($album_user_access['moderator'])  
  155.         {  
  156.             if ($album_config['mod_pics_limit'] >= 0)  
  157.             {  
  158.                 $check_user_limit = 'mod_pics_limit';  
  159.             }  
  160.         }  
  161.         else  
  162.         {  
  163.             if ($album_config['user_pics_limit'] >= 0)  
  164.             {  
  165.                 $check_user_limit = 'user_pics_limit';  
  166.             }  
  167.         }  
  168.     }  
  169.  
  170.     // Do the check here  
  171.     if ($check_user_limit != FALSE)  
  172.     {  
  173.         $sql = "SELECT COUNT(pic_id) AS count  
  174.                 FROM ". ALBUM_TABLE ."  
  175.                 WHERE pic_user_id = '". $userdata['user_id'] ."'  
  176.                     AND pic_cat_id = '$cat_id'";  
  177.         if( !($result = $db->sql_query($sql)) )  
  178.         {  
  179.             message_die(GENERAL_ERROR, 'Could not count your pic', '', __LINE__, __FILE__, $sql);  
  180.         }  
  181.         $row = $db->sql_fetchrow($result);  
  182.         $own_pics = $row['count'];  
  183.  
  184.         if( $own_pics >= $album_config[$check_user_limit] )  
  185.         {  
  186.             message_die(GENERAL_MESSAGE, $lang['User_reached_pics_quota']);  
  187.         }  
  188.     }  
  189. }  
  190. else  
  191. {  
  192.     if( ($current_pics >= $album_config['personal_gallery_limit']) and ($album_config['personal_gallery_limit'] >= 0) )  
  193.     {  
  194.         message_die(GENERAL_MESSAGE, $lang['Album_reached_quota']);  
  195.     }  
  196. }  
  197.  
  198. /*  
  199. +----------------------------------------------------------  
  200. | Main work here...  
  201. +----------------------------------------------------------  
  202. */  
  203.  
  204. if( !isset($HTTP_POST_VARS['pic_title']) ) // is it not submitted?  
  205. {  
  206.     // --------------------------------  
  207.     // Build categories select  
  208.     // --------------------------------  
  209.     $sql = "SELECT *  
  210.             FROM " . ALBUM_CAT_TABLE ."  
  211.             ORDER BY cat_order ASC";  
  212.     if( !($result = $db->sql_query($sql)) )  
  213.     {  
  214.         message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);  
  215.     }  
  216.  
  217.     $catrows = array();  
  218.  
  219.     while( $row = $db->sql_fetchrow($result) )  
  220.     {  
  221.         $thiscat_access = album_user_access($row['cat_id'], $row, 0, 1, 0, 0, 0, 0); // UPLOAD  
  222.  
  223.         if ($thiscat_access['upload'] == 1)  
  224.         {  
  225.             $catrows[] = $row;  
  226.         }  
  227.     }  
  228.  
  229.     $select_cat = '<select name="cat_id">';  
  230.  
  231.     if ($cat_id == PERSONAL_GALLERY)  
  232.     {  
  233.         $select_cat .= '<option value="$cat_id" selected="selected">';  
  234.         $select_cat .= sprintf($lang['Personal_Gallery_Of_User'], $userdata['username']);  
  235.         $select_cat .= '</option>';  
  236.     }  
  237.  
  238.     for ($i = 0; $i < count($catrows); $i++)  
  239.     {  
  240.         $select_cat .= '<option value="'. $catrows[$i]['cat_id'] .'" ';  
  241.         $select_cat .= ($cat_id == $catrows[$i]['cat_id']) ? 'selected="selected"' : '';  
  242.         $select_cat .= '>'. $catrows[$i]['cat_title'] .'</option>';  
  243.     }  
  244.  
  245.     $select_cat .= '</select>';  
  246.  
  247.     //  
  248.     // Start output of page  
  249.     //  
  250.     $page_title = $lang['Album'];  
  251.     include($phpbb_root_path . 'includes/page_header.'.$phpEx);  
  252.  
  253.     $template->set_filenames(array(  
  254.         'body' => 'album_upload_body.tpl')  
  255.     );  
  256.  
  257.     $template->assign_vars(array(  
  258.         'U_VIEW_CAT' => ($cat_id != PERSONAL_GALLERY) ? append_sid("album_cat.$phpEx?cat_id=$cat_id") : append_sid("album_personal.$phpEx"),  
  259.         'CAT_TITLE' => $thiscat['cat_title'],  
  260.  
  261.         'L_UPLOAD_PIC' => $lang['Upload_Pic'],  
  262.  
  263.         'L_USERNAME' => $lang['Username'],  
  264.         'L_PIC_TITLE' => $lang['Pic_Title'],  
  265.  
  266.         'L_PIC_DESC' => $lang['Pic_Desc'],  
  267.         'L_PLAIN_TEXT_ONLY' => $lang['Plain_text_only'],  
  268.         'L_MAX_LENGTH' => $lang['Max_length'],  
  269.         'S_PIC_DESC_MAX_LENGTH' => $album_config['desc_length'],  
  270.  
  271.         'L_UPLOAD_PIC_FROM_MACHINE' => $lang['Upload_pic_from_machine'],  
  272.         'L_UPLOAD_TO_CATEGORY' => $lang['Upload_to_Category'],  
  273.  
  274.         'SELECT_CAT' => $select_cat,  
  275.  
  276.         'L_MAX_FILESIZE' => $lang['Max_file_size'],  
  277.         'S_MAX_FILESIZE' => $album_config['max_file_size'],  
  278.  
  279.         'L_MAX_WIDTH' => $lang['Max_width'],  
  280.         'L_MAX_HEIGHT' => $lang['Max_height'],  
  281.  
  282.         'S_MAX_WIDTH' => $album_config['max_width'],  
  283.         'S_MAX_HEIGHT' => $album_config['max_height'],  
  284.  
  285.         'L_ALLOWED_JPG' => $lang['JPG_allowed'],  
  286.         'L_ALLOWED_PNG' => $lang['PNG_allowed'],  
  287.         'L_ALLOWED_GIF' => $lang['GIF_allowed'],  
  288.  
  289.         'S_JPG' => ($album_config['jpg_allowed'] == 1) ? $lang['Yes'] : $lang['No'],  
  290.         'S_PNG' => ($album_config['png_allowed'] == 1) ? $lang['Yes'] : $lang['No'],  
  291.         'S_GIF' => ($album_config['gif_allowed'] == 1) ? $lang['Yes'] : $lang['No'],  
  292.  
  293.         'L_UPLOAD_NO_TITLE' => $lang['Upload_no_title'],  
  294.         'L_UPLOAD_NO_FILE' => $lang['Upload_no_file'],  
  295.         'L_DESC_TOO_LONG' => $lang['Desc_too_long'],  
  296.  
  297.         // Manual Thumbnail  
  298.         'L_UPLOAD_THUMBNAIL' => $lang['Upload_thumbnail'],  
  299.         'L_UPLOAD_THUMBNAIL_EXPLAIN' => $lang['Upload_thumbnail_explain'],  
  300.         'L_THUMBNAIL_SIZE' => $lang['Thumbnail_size'],  
  301.         'S_THUMBNAIL_SIZE' => $album_config['thumbnail_size'],  
  302.  
  303.         'L_RESET' => $lang['Reset'],  
  304.         'L_SUBMIT' => $lang['Submit'],  
  305.  
  306.         'S_ALBUM_ACTION' => append_sid("album_upload.$phpEx?cat_id=$cat_id"),  
  307.         )  
  308.     );  
  309.  
  310.     if ($album_config['gd_version'] == 0)  
  311.     {  
  312.         $template->assign_block_vars('switch_manual_thumbnail', array());  
  313.     }  
  314.  
  315.     //  
  316.     // Generate the page  
  317.     //  
  318.     $template->pparse('body');  
  319.  
  320.     include($phpbb_root_path . 'includes/page_tail.'.$phpEx);  
  321. }  
  322. else  
  323. {  
  324.     // --------------------------------  
  325.     // Check posted info  
  326.     // --------------------------------  
  327.  
  328.     $pic_title = str_replace("'", "''", htmlspecialchars(trim($HTTP_POST_VARS['pic_title'])));  
  329.  
  330.     $pic_desc = str_replace("'", "''", htmlspecialchars(substr(trim($HTTP_POST_VARS['pic_desc']), 0, $album_config['desc_length'])));  
  331.  
  332.     $pic_username = (!$userdata['session_logged_in']) ? substr(str_replace("'", "''", htmlspecialchars(trim($HTTP_POST_VARS['pic_username']))), 0, 32) : str_replace("'", "''", $userdata['username']);  
  333.  
  334.     if( empty($pic_title) )  
  335.     {  
  336.         message_die(GENERAL_ERROR, $lang['Missed_pic_title']);  
  337.     }  
  338.  
  339.     if( !isset($HTTP_POST_FILES['pic_file']) )  
  340.     {  
  341.         message_die(GENERAL_ERROR, 'Bad Upload');  
  342.     }  
  343.  
  344.  
  345.     // --------------------------------  
  346.     // Check username for guest posting  
  347.     // --------------------------------  
  348.  
  349.     if (!$userdata['session_logged_in'])  
  350.     {  
  351.         if ($pic_username != '')  
  352.         {  
  353.             $result = validate_username($pic_username);  
  354.             if ( $result['error'] )  
  355.             {  
  356.                 message_die(GENERAL_MESSAGE, $result['error_msg']);  
  357.             }  
  358.         }  
  359.     }      
  360.  
  361.  
  362.     // --------------------------------  
  363.     // Get File Upload Info  
  364.     // --------------------------------  
  365.  
  366.     $filetype = $HTTP_POST_FILES['pic_file']['type'];  
  367.     $filesize = $HTTP_POST_FILES['pic_file']['size'];  
  368.     $filetmp = $HTTP_POST_FILES['pic_file']['tmp_name'];  
  369.  
  370.     if ($album_config['gd_version'] == 0)  
  371.     {  
  372.         $thumbtype = $HTTP_POST_FILES['pic_thumbnail']['type'];  
  373.         $thumbsize = $HTTP_POST_FILES['pic_thumbnail']['size'];  
  374.         $thumbtmp = $HTTP_POST_FILES['pic_thumbnail']['tmp_name'];  
  375.     }  
  376.  
  377.  
  378.     // --------------------------------  
  379.     // Prepare variables  
  380.     // --------------------------------  
  381.  
  382.     $pic_time = time();  
  383.     $pic_user_id = $userdata['user_id'];  
  384.     $pic_user_ip = $userdata['session_ip'];  
  385.  
  386.  
  387.     // --------------------------------  
  388.     // Check file size  
  389.     // --------------------------------  
  390.  
  391.     if( ($filesize == 0) or ($filesize > $album_config['max_file_size']) )  
  392.     {  
  393.         message_die(GENERAL_MESSAGE, $lang['Bad_upload_file_size']);  
  394.     }  
  395.  
  396.     if ($album_config['gd_version'] == 0)  
  397.     {  
  398.         if( ($thumbsize == 0) or ($thumbsize > $album_config['max_file_size']) )  
  399.         {  
  400.             message_die(GENERAL_MESSAGE, $lang['Bad_upload_file_size']);  
  401.         }  
  402.     }  
  403.  
  404.  
  405.     // --------------------------------  
  406.     // Check file type  
  407.     // --------------------------------  
  408.  
  409.     switch ($filetype)  
  410.     {  
  411.         case 'image/jpeg':  
  412.         case 'image/jpg':  
  413.         case 'image/pjpeg':  
  414.             if ($album_config['jpg_allowed'] == 0)  
  415.             {  
  416.                 message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']);  
  417.             }  
  418.             $pic_filetype = '.jpg';  
  419.             break;  
  420.  
  421.         case 'image/png':  
  422.         case 'image/x-png':  
  423.             if ($album_config['png_allowed'] == 0)  
  424.             {  
  425.                 message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']);  
  426.             }  
  427.             $pic_filetype = '.png';  
  428.             break;  
  429.  
  430.         case 'image/gif':  
  431.             if ($album_config['gif_allowed'] == 0)  
  432.             {  
  433.                 message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']);  
  434.             }  
  435.             $pic_filetype = '.gif';  
  436.             break;  
  437.         default:  
  438.             message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']);  
  439.     }  
  440.  
  441.     if ($album_config['gd_version'] == 0)  
  442.     {  
  443.         if ($filetype != $thumbtype)  
  444.         {  
  445.             message_die(GENERAL_ERROR, $lang['Filetype_and_thumbtype_do_not_match']);  
  446.         }  
  447.     }  
  448.  
  449.  
  450.     // --------------------------------  
  451.     // Generate filename  
  452.     // --------------------------------  
  453.  
  454.     srand((double)microtime()*1000000);    // for older than version 4.2.0 of PHP  
  455.  
  456.     do  
  457.     {  
  458.         $pic_filename = md5(uniqid(rand())) . $pic_filetype;  
  459.     }  
  460.     while( file_exists(ALBUM_UPLOAD_PATH . $pic_filename) );  
  461.  
  462.     if ($album_config['gd_version'] == 0)  
  463.     {  
  464.         $pic_thumbnail = $pic_filename;  
  465.     }  
  466.  
  467.  
  468.     // --------------------------------  
  469.     // Move this file to upload directory  
  470.     // --------------------------------  
  471.  
  472.     $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';  
  473.  
  474.     if ( @$ini_val('open_basedir') != '' )  
  475.     {  
  476.         if ( @phpversion() < '4.0.3' )  
  477.         {  
  478.             message_die(GENERAL_ERROR, 'open_basedir is set and your PHP version does not allow move_uploaded_file<br /><br />Please contact your server admin', '', __LINE__, __FILE__);  
  479.         }  
  480.  
  481.         $move_file = 'move_uploaded_file';  
  482.     }  
  483.     else  
  484.     {  
  485.         $move_file = 'copy';  
  486.     }  
  487.  
  488.     $move_file($filetmp, ALBUM_UPLOAD_PATH . $pic_filename);  
  489.  
  490.     @chmod(ALBUM_UPLOAD_PATH . $pic_filename, 0777);  
  491.  
  492.     if ($album_config['gd_version'] == 0)  
  493.     {  
  494.         $move_file($thumbtmp, ALBUM_CACHE_PATH . $pic_thumbnail);  
  495.  
  496.         @chmod(ALBUM_CACHE_PATH . $pic_thumbnail, 0777);  
  497.     }  
  498.  
  499.  
  500.     // --------------------------------  
  501.     // Well, it's an image. Check its image size  
  502.     // --------------------------------  
  503.  
  504.     $pic_size = getimagesize(ALBUM_UPLOAD_PATH . $pic_filename);  
  505.  
  506.     $pic_width = $pic_size[0];  
  507.     $pic_height = $pic_size[1];  
  508.  
  509.     if ( ($pic_width > $album_config['max_width']) or ($pic_height > $album_config['max_height']) )  
  510.     {  
  511.         @unlink(ALBUM_UPLOAD_PATH . $pic_filename);  
  512.  
  513.         if ($album_config['gd_version'] == 0)  
  514.         {  
  515.             @unlink(ALBUM_CACHE_PATH . $pic_thumbnail);  
  516.         }  
  517.  
  518.         message_die(GENERAL_ERROR, $lang['Upload_image_size_too_big']);  
  519.     }  
  520.  
  521.     if ($album_config['gd_version'] == 0)  
  522.     {  
  523.         $thumb_size = getimagesize(ALBUM_CACHE_PATH . $pic_thumbnail);  
  524.  
  525.         $thumb_width = $thumb_size[0];  
  526.         $thumb_height = $thumb_size[1];  
  527.  
  528.         if ( ($thumb_width > $album_config['thumbnail_size']) or ($thumb_height > $album_config['thumbnail_size']) )  
  529.         {  
  530.             @unlink(ALBUM_UPLOAD_PATH . $pic_filename);  
  531.  
  532.             @unlink(ALBUM_CACHE_PATH . $pic_thumbnail);  
  533.  
  534.             message_die(GENERAL_ERROR, $lang['Upload_thumbnail_size_too_big']);  
  535.         }  
  536.     }  
  537.  
  538.  
  539.     // --------------------------------  
  540.     // This image is okay, we can cache its thumbnail now  
  541.     // --------------------------------  
  542.  
  543.     if( ($album_config['thumbnail_cache'] == 1) and ($pic_filetype != '.gif') and ($album_config['gd_version'] > 0) )  
  544.     {  
  545.         $gd_errored = FALSE;  
  546.  
  547.         switch ($pic_filetype)  
  548.         {  
  549.             case '.jpg':  
  550.                 $read_function = 'imagecreatefromjpeg';  
  551.                 break;  
  552.             case '.png':  
  553.                 $read_function = 'imagecreatefrompng';  
  554.                 break;  
  555.         }  
  556.  
  557.         $src = @$read_function(ALBUM_UPLOAD_PATH  . $pic_filename);  
  558.  
  559.         if (!$src)  
  560.         {  
  561.             $gd_errored = TRUE;  
  562.             $pic_thumbnail = '';  
  563.         }  
  564.         else if( ($pic_width > $album_config['thumbnail_size']) or ($pic_height > $album_config['thumbnail_size']) )  
  565.         {  
  566.             // Resize it  
  567.             if ($pic_width > $pic_height)  
  568.             {  
  569.                 $thumbnail_width = $album_config['thumbnail_size'];  
  570.                 $thumbnail_height = $album_config['thumbnail_size'] * ($pic_height/$pic_width);  
  571.             }  
  572.             else  
  573.             {  
  574.                 $thumbnail_height = $album_config['thumbnail_size'];  
  575.                 $thumbnail_width = $album_config['thumbnail_size'] * ($pic_width/$pic_height);  
  576.             }  
  577.  
  578.             $thumbnail = ($album_config['gd_version'] == 1) ? @imagecreate($thumbnail_width, $thumbnail_height) : @imagecreatetruecolor($thumbnail_width, $thumbnail_height);  
  579.  
  580.             $resize_function = ($album_config['gd_version'] == 1) ? 'imagecopyresized' : 'imagecopyresampled';  
  581.  
  582.             @$resize_function($thumbnail, $src, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, $pic_width, $pic_height);  
  583.         }  
  584.         else  
  585.         {  
  586.             $thumbnail = $src;  
  587.         }  
  588.  
  589.         if (!$gd_errored)  
  590.         {  
  591.             $pic_thumbnail = $pic_filename;  
  592.  
  593.             // Write to disk  
  594.             switch ($pic_filetype)  
  595.             {  
  596.                 case '.jpg':  
  597.                     @imagejpeg($thumbnail, ALBUM_CACHE_PATH . $pic_thumbnail, $album_config['thumbnail_quality']);  
  598.                     break;  
  599.                 case '.png':  
  600.                     @imagepng($thumbnail, ALBUM_CACHE_PATH . $pic_thumbnail);  
  601.                     break;  
  602.             }  
  603.  
  604.             @chmod(ALBUM_CACHE_PATH . $pic_thumbnail, 0777);  
  605.  
  606.         } // End IF $gd_errored  
  607.  
  608.     } // End Thumbnail Cache  
  609.     else if ($album_config['gd_version'] > 0)  
  610.     {  
  611.         $pic_thumbnail = '';  
  612.     }  
  613.  
  614.     // --------------------------------  
  615.     // Check Pic Approval  
  616.     // --------------------------------  
  617.  
  618.     $pic_approval = ($thiscat['cat_approval'] == 0) ? 1 : 0;  
  619.  
  620.  
  621.     // --------------------------------  
  622.     // Insert into DB  
  623.     // --------------------------------  
  624.  
  625.     $sql = "INSERT INTO ". ALBUM_TABLE ." (pic_filename, pic_thumbnail, pic_title, pic_desc, pic_user_id, pic_user_ip, pic_username, pic_time, pic_cat_id, pic_approval)  
  626.             VALUES ('$pic_filename', '$pic_thumbnail', '$pic_title', '$pic_desc', '$pic_user_id', '$pic_user_ip', '$pic_username', '$pic_time', '$cat_id', '$pic_approval')";  
  627.     if( !$result = $db->sql_query($sql) )  
  628.     {  
  629.         message_die(GENERAL_ERROR, 'Could not insert new entry', '', __LINE__, __FILE__, $sql);  
  630.     }  
  631.  
  632.  
  633.     // --------------------------------  
  634.     // Complete... now send a message to user  
  635.     // --------------------------------  
  636.  
  637.     if ($thiscat['cat_approval'] == 0)  
  638.     {  
  639.         $message = $lang['Album_upload_successful'];  
  640.     }  
  641.     else  
  642.     {  
  643.         $message = $lang['Album_upload_need_approval'];  
  644.     }  
  645.  
  646.     if ($cat_id != PERSONAL_GALLERY)  
  647.     {  
  648.         if ($thiscat['cat_approval'] == 0)  
  649.         {  
  650.             $template->assign_vars(array(  
  651.                 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("album_cat.$phpEx?cat_id=$cat_id") . '">')  
  652.             );  
  653.         }  
  654.  
  655.         $message .= "<br /><br />" . sprintf($lang['Click_return_category'], "<a href="" . append_sid("album_cat.$phpEx?cat_id=$cat_id") . "">", "</a>");  
  656.     }  
  657.     else  
  658.     {  
  659.         if ($thiscat['cat_approval'] == 0)  
  660.         {  
  661.             $template->assign_vars(array(  
  662.                 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("album_personal.$phpEx") . '">')  
  663.             );  
  664.         }  
  665.  
  666.         $message .= "<br /><br />" . sprintf($lang['Click_return_personal_gallery'], "<a href="" . append_sid("album_personal.$phpEx") . "">", "</a>");  
  667.     }  
  668.  
  669.  
  670.     $message .= "<br /><br />" . sprintf($lang['Click_return_album_index'], "<a href="" . append_sid("album.$phpEx") . "">", "</a>");  
  671.  
  672.     message_die(GENERAL_MESSAGE, $message);  
  673. }  
  674.  
  675.  
  676. // +------------------------------------------------------+  
  677. // |  Powered by Photo Album 2.x.x (c) 2002-2003 Smartor  |  
  678. // +------------------------------------------------------+  
  679.  
  680. ?> 

 



 
Edited by KugeLSichA, Mon 26 Feb, 2007 18:16: changed QUOTE tags to CODE tags
JezUK1Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
I Think you must use FAP for this mod
or look to http://smartor.is-root.com/
 



 
pepiSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
Hi pepi,

did you tested it with Icy? and is it working there?

greetz
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
No I have not yet.
 



 
JezUK1Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
The posting while uploading mod works fine on the latest version of FAP, i posted these links in a previous thread. The only part that does not work is the when posting an album image in a PM. FAP is required unless you have already modded albumimg tags into the forum.
 



 
krisbfunkSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
In Recent Public Pics is it possible when you click on the image to redirect to the topic where that image as been posted.

Thanks for any help.
 



 
ninicocoSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 

 



 
blokeSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 




----------------------------------------------
Spam Removed
 



 
Edited by Joshua203, Wed 08 Jun, 2011 14:42: spam removal and user banned
candy rainSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Is There Such A Thing? 
 
candy rain wrote: [View Post]




----------------------------------------------
Spam Removed



WTF?

Why are you replying a topic from a year ago just to say that?
 



 
Edited by Joshua203, Wed 08 Jun, 2011 14:43: Spam in quote removed
wachowskiSend private message  
Back to topPage bottom
This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies.  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron