Author Topic: [MOD] auth_email V 0.8 for Pictures Email Upload V1.7.x  (Read 11358 times)

0 Members and 1 Guest are viewing this topic.

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
[MOD] auth_email V 0.8 for Pictures Email Upload V1.7.x
« on: December 13, 2010, 09:08:06 PM »
Hello,

i've just write some modification for the MOD Pictures Email Upload V1.7.8 http://www.4homepages.de/forum/index.php?topic=23681

This little MOD is not finished jet, because i'm not able to make the selection for user by dropdown-list - i've no idea to solve this by myself  :oops:
Please be patient to help me  :wink:

What will this MOD do (V 0.5)?

- in ACP you provide some mailadresses for using "Pictures Email Upload" eMail_upload.php without have to use the subject
- in ACP you provide the default category
- in ACP you provide the default user (in this time by user-number, i'll hope to finish by dropdown)
new V 0.8
- in ACP set "all", if you like to enable emailupload without check mailadresses
- in UserCP user set up eMail-Adress for emailupload (separate from 4images mailadress)
- in UserCP user set up category by using v@no [MOD] Categories upload dropdown form (http://www.4homepages.de/forum/index.php?topic=7722.0)
- in ACP user-section enable/disable each user using personal emailupload-config
- in eMail_upload.php new column "Auth" display, whitch rule matches

pending things:
- dropdown userselect for ACP
- dropdown categoryselect for ACP in user setting
- check unique mailadress in member.php (to ensure no users use same imagesupload-maildress)
- solution for change cat-setting in ACP/UserCP while cat deleted (or user lost rights for upload in cat with future function while direct-upload)

Whischlist: If user have right to direct upload images in cat, images direct send into db instead of temp-table for validating.
This function may be inclue into original MOD ;-)

Mail checks in follow priority:
1) mail with POP-Code
2) mailadress from personal uploadmailadress by user
3) mailadress from ACP (list or "all")
This provide to sort images into category by POP-Code but also use the "easy way" like user personal settings.

Attention: Mails must have no subject to select by the new rules.

After setting up, you are able to use the standard from the MOD by providing parameters in subject or
you send email from listet adress without subject and the attached images (vids ...) prepared automatic for validateimages.php

Please back up your files and database!

you have to change:
/admin/settings.php
/admin/users.php
/admin/plugins/eMail_upload.php
/includes/sessions.php
/includes/functions.php
/lang/xxx/admin.php
/lang/xxx/main.php
/templates/xxx/member_editprofile.html

First install [MOD] Categories upload dropdown form (http://www.4homepages.de/forum/index.php?topic=7722.0)

Second update database with phpmyadmin:

Code: [Select]
ALTER TABLE `4images_users` ADD `user_emailupload` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
ADD `user_emailupload_active` TINYINT NOT NULL DEFAULT '0', ADD `user_emailupload_cat` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';

If you have not install the first version, you need also:
Code: [Select]
INSERT INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('noauth_mail', ''), ('noauth_mail_cat', ''), ('noauth_mail_user', '');
Next few steps are different betwen update from V 0.5 or new install.

step 1) in /admin/settings.php (not if update)
search for:
// end of functions
insert above:
function show_categorory_select($setting_name$setting_value)
{
 global 
$cat_parent_cache$drop_down_cat_cache$lang;
  
$drop_down_cat_cache $cat_parent_cache;
  echo 
"<select name=\"setting_item[".$setting_name."]\" class=\"categoryselect\">";
  echo 
"<option value=\"0\">".$lang['select_category']."</option>";
  echo 
"<option value=\"0\">-------------------------------</option>";
  echo 
get_category_dropdown_bits((int)$setting_value);
  echo 
"</select>";
}


step 1.1) (not if update)
search for:
  show_setting_row("pop_code");
add after:
  show_setting_row("noauth_mail""textarea");
  
show_setting_row("noauth_mail_cat""show_categorory_select");
  
show_setting_row("noauth_mail_user");



step 2a) in /admin/plugins/eMail_upload.php (not if update)
search for:
  $sql "SELECT  setting_value as noauth_mail FROM ".SETTINGS_TABLE." WHERE setting_name = 'noauth_mail'"// Mailadressen abfragen
    
$result $site_db->query($sql); $row mysql_fetch_object($result);
      
$noauth_mail $row->noauth_mail;
 
     if ((
$array[0] == "$user_name&& $array[1] == $config['pop_code']) || (strstr($noauth_mail$head['from']) && $head['subject'] == ""))
     {
	
if (
strstr($noauth_mail$head['from']) && $head['subject'] == "") {
	
 
$sql "SELECT  setting_value as noauth_mail_cat FROM ".SETTINGS_TABLE." WHERE setting_name = 'noauth_mail_cat'"// Kategorie abfragen
	
  
$result $site_db->query($sql); $row mysql_fetch_object($result);
	
   
$cat_id $row->noauth_mail_cat;

	
 
$sql "SELECT cat_id, cat_name FROM ".CATEGORIES_TABLE." WHERE cat_id = $cat_id"// Kategorienamen abfragen
	
  
$result $site_db->query($sql); 
	
   
$row $site_db->fetch_array($result);
           
$cat_name $row[cat_name];

	
 
$sql "SELECT  setting_value as noauth_mail_user FROM ".SETTINGS_TABLE." WHERE setting_name = 'noauth_mail_user'"// User-ID abfragen
	
  
$result $site_db->query($sql); $row mysql_fetch_object($result);
	
   
$user_id $row->noauth_mail_user;

	
 
$sql "SELECT user_id, user_name FROM ".USERS_TABLE." WHERE user_id = $user_id"// Usernamen abfragen
 
	
  
$result $site_db->query($sql); 
         
$row $site_db->fetch_array($result);
         
$user_name $row[user_name];
     }
     
$path MEDIA_TEMP_PATH."/";

replace with:
      if ($array[0] == "$user_name&& $array[1] == $config['pop_code']){
        
$path MEDIA_TEMP_PATH."/";


step 2) in /admin/plugins/eMail_upload.php
search for:
    echo '<td class="tableheader" width=3%>Nr.</td>';
add after:
    echo '<td class="tableheader" width=5%>Auth</td>';

step 2.1) in /admin/plugins/eMail_upload.php
search for:
      $sql "SELECT u.user_id, u.user_name, c.cat_id, c.cat_name
              FROM ("
.USERS_TABLE." u, ".CATEGORIES_TABLE." c)
              WHERE user_name = '
$array[0]' AND cat_id = '$array[2]'
             "

      
$result $site_db->query($sql); 
      
$row $site_db->fetch_array($result);
      
$user_name $row[user_name];
      
$user_id $row[user_id];
      
$cat_name $row[cat_name];
      
$cat_id $row[cat_id];  
      
      if (
$array[0] == "$user_name&& $array[1] == $config['pop_code']){
        
$path MEDIA_TEMP_PATH."/";

replace with:
	
if (
$head['subject'] != ""){
   
      
$sql "SELECT u.user_id, u.user_name, c.cat_id, c.cat_name
              FROM ("
.USERS_TABLE." u, ".CATEGORIES_TABLE." c)
              WHERE user_name = '
$array[0]' AND cat_id = '$array[2]'
             "

      
$result $site_db->query($sql); 
      
$row $site_db->fetch_array($result);
      
$user_name $row[user_name];
      
$user_id $row[user_id];
      
$cat_name $row[cat_name];
      
$cat_id $row[cat_id]; 
      
$authselect "POP-Code";
	
}
	
else
	
{

	
	
$from $head['from']; 
	
        
$sql "SELECT u.user_id, u.user_name, u.user_emailupload, u.user_emailupload_cat, u.user_emailupload_active, c.cat_id, c.cat_name
        
	
      FROM "
.USERS_TABLE." u
	
              LEFT JOIN "
.CATEGORIES_TABLE." c ON (".get_user_table_field("u.""user_emailupload_cat")." = c.cat_id)
        
	
      WHERE user_emailupload_active = 1 and user_emailupload = '
$from'";
	
        
$result $site_db->query($sql);
	
        
$num_rows $site_db->get_numrows($result);
	
	
 if (
$num_rows != 0) {
	
        
	
$row $site_db->fetch_array($result);
	
        
	
$noauth_mail $row[user_emailupload];
        
	
	
$user_name $row[user_name];
        
	
	
$user_id $row[user_id];
	
        
	
$cat_name $row[cat_name];
        
	
	
$cat_id $row[cat_id];  
	
	
        
$authselect "UserUpMail";
	
	

	
	
else {
	
	
	
$sql "SELECT  setting_value as noauth_mail FROM ".SETTINGS_TABLE." WHERE setting_name = 'noauth_mail'"// Mailadressen abfragen
	
    
	
	
$result $site_db->query($sql);
     
	
	
	
$row mysql_fetch_object($result);
   
	
   
	
	
$noauth_mail $row->noauth_mail;
	
	
	
if (
strstr($noauth_mail"all")) {
	
	
	
	
$authselect "<b>ACPUpALL</b>";
	
	
	

	
	
	
else {
	
	
	
	
$authselect "ACPUpMail";
	
	
	
}

	
	
	
$sql "SELECT  setting_value as noauth_mail_cat FROM ".SETTINGS_TABLE." WHERE setting_name = 'noauth_mail_cat'"// Kategorie abfragen
	
	
	
 
$result $site_db->query($sql); 
	
	
	
  
$row mysql_fetch_object($result);
	
	
	
  
$cat_id $row->noauth_mail_cat;
	
	
	
$sql "SELECT cat_id, cat_name FROM ".CATEGORIES_TABLE." WHERE cat_id = $cat_id"// Kategorienamen abfragen
	
	
	
  
$result $site_db->query($sql); 
	
	
	
   
$row $site_db->fetch_array($result);
	
	
           
$cat_name $row[cat_name];
	
	
	
$sql "SELECT  setting_value as noauth_mail_user FROM ".SETTINGS_TABLE." WHERE setting_name = 'noauth_mail_user'"// User-ID abfragen
	
	
	
 
$result $site_db->query($sql); 
	
	
	
  
$row mysql_fetch_object($result);
	
	
	
  
$user_id $row->noauth_mail_user;
	
	
	
$sql "SELECT user_id, user_name FROM ".USERS_TABLE." WHERE user_id = $user_id"// Usernamen abfragen
	
	
	
  
$result $site_db->query($sql); 
	
	
          
$row $site_db->fetch_array($result);
	
	
          
$user_name $row[user_name];

	
	

	
}
     if ((
$array[0] == "$user_name&& $array[1] == $config['pop_code']) || (strstr($noauth_mail$head['from']) && $head['subject'] == "") || (strstr($noauth_mail"all") && $head['subject'] == ""))
     {

     
$path MEDIA_TEMP_PATH."/";


step 2.2) in /admin/plugins/eMail_upload.php
search for:
        echo '<td width=3%>'.$i.'</td>';
add after:
        echo '<td width=5%>'.$authselect.'</td>';
do replace twice!


step 3.0) in /admin/users.php
search for:
  $user_invisible intval($HTTP_POST_VARS['user_invisible']);
add after:
  $user_emailupload_active intval($HTTP_POST_VARS['user_emailupload_active']);
  
$user_emailupload trim($HTTP_POST_VARS['user_emailupload']);
  
$user_emailupload_cat trim($HTTP_POST_VARS['user_emailupload_cat']);


step 3.1) in /admin/users.php
search for:
            SET ".get_user_table_field("", "user_level")." $user_level".get_user_table_field("", "user_name")." '$user_name',$passinsert ".get_user_table_field("", "user_email")." '$user_email'".get_user_table_field("", "user_showemail")." $user_showemail".get_user_table_field("", "user_allowemails")." $user_allowemails".get_user_table_field("", "user_invisible")." $user_invisible".get_user_table_field("", "user_joindate")." $user_joindate".get_user_table_field("", "user_lastaction")." $user_lastaction".get_user_table_field("", "user_homepage")." '$user_homepage'".get_user_table_field("", "user_icq")." '$user_icq'".$additional_sql."

replace with:
            SET ".get_user_table_field("", "user_level")." $user_level".get_user_table_field("", "user_name")." '$user_name',$passinsert ".get_user_table_field("", "user_email")." '$user_email'".get_user_table_field("", "user_showemail")." $user_showemail".get_user_table_field("", "user_allowemails")." $user_allowemails".get_user_table_field("", "user_invisible")." $user_invisible".get_user_table_field("", "user_emailupload_active")." $user_emailupload_active".get_user_table_field("", "user_emailupload")." '$user_emailupload'".get_user_table_field("", "user_emailupload_cat")." $user_emailupload_cat".get_user_table_field("", "user_joindate")." $user_joindate".get_user_table_field("", "user_lastaction")." $user_lastaction".get_user_table_field("", "user_homepage")." '$user_homepage'".get_user_table_field("", "user_icq")." '$user_icq'".$additional_sql."


step 3.2) in /admin/users.php
search for:
  show_date_input_row($lang['field_lastaction'].$lang['date_desc'], "user_lastaction"$user_row['user_lastaction'], $textinput_size);
add after:
  show_radio_row($lang['field_emailupload_active'], "user_emailupload_active"$user_row['user_emailupload_active']);
  
show_input_row($lang['field_user_emailupload'], "user_emailupload"$user_row['user_emailupload'], $textinput_size);
  
show_input_row($lang['field_user_emailupload_cat'], "user_emailupload_cat"$user_row['user_emailupload_cat'], $textinput_size);



step 3.3) in /admin/users.php
search for:
      $user_invisible intval($HTTP_POST_VARS['user_invisible_'.$i]);
add after:
      $user_emailupload_active intval($HTTP_POST_VARS['user_emailupload_active_'.$i]);
      
$user_emailupload trim($HTTP_POST_VARS['user_emailupload_'.$i]);
      
$user_emailupload_cat intval(trim($HTTP_POST_VARS['user_emailupload_cat_'.$i]));


step 3.4) in /admin/users.php
search for:
      $sql "INSERT INTO ".USERS_TABLE."
              ("
.get_user_table_field("""user_id").get_user_table_field(", ""user_level").get_user_table_field(", ""user_name").get_user_table_field(", ""user_password").get_user_table_field(", ""user_email").get_user_table_field(", ""user_showemail").get_user_table_field(", ""user_allowemails").get_user_table_field(", ""user_invisible").get_user_table_field(", ""user_joindate").get_user_table_field(", ""user_activationkey").get_user_table_field(", ""user_lastaction").get_user_table_field(", ""user_lastvisit").get_user_table_field(", ""user_comments").get_user_table_field(", ""user_homepage").get_user_table_field(", ""user_icq").$additional_field_sql.")
              VALUES
              (
$user_id$user_level, '$user_name', '$user_password', '$user_email', $user_showemail$user_allowemails$user_invisible$current_time, '$activationkey', $current_time$current_time, 0, '$user_homepage', '$user_icq'".$additional_value_sql.")";

replace with:
              (".get_user_table_field("", "user_id").get_user_table_field("", "user_level").get_user_table_field("", "user_name").get_user_table_field("", "user_password").get_user_table_field("", "user_email").get_user_table_field("", "user_showemail").get_user_table_field("", "user_allowemails").get_user_table_field("", "user_invisible").get_user_table_field("", "user_joindate").get_user_table_field("", "user_emailupload_active").get_user_table_field("", "user_emailupload").get_user_table_field("", "user_emailupload_cat").get_user_table_field("", "user_activationkey").get_user_table_field("", "user_lastaction").get_user_table_field("", "user_lastvisit").get_user_table_field("", "user_comments").get_user_table_field("", "user_homepage").get_user_table_field("", "user_icq").$additional_field_sql.")
              
VALUES
              
($user_id$user_level'$user_name''$user_password''$user_email'$user_showemail$user_allowemails$user_invisible$current_time$user_emailupload_active'$user_emailupload'$user_emailupload_cat'$activationkey'$current_time$current_time0'$user_homepage''$user_icq'".$additional_value_sql.")";


step 3.4) in /admin/users.php
search for:
    show_radio_row($lang['field_invisible'], "user_invisible_".$i0);
add after:
    show_radio_row($lang['field_emailupload_active'], "user_emailupload_active_".$i0);
    
show_input_row($lang['field_user_emailupload'], "user_emailupload_".$i0);
    
show_input_row($lang['field_user_emailupload_cat'], "user_emailupload_cat_".$i0);



step 4) in /includes/sessions.php
search for:
  "user_homepage" => "user_homepage",
add after:
  "user_emailupload" => "user_emailupload",
  
"user_emailupload_cat" => "user_emailupload_cat",
  
"user_emailupload_active" => "user_emailupload_active",


step 5) in /lang/xxx/main.php
search for:
$lang['icq'] = "ICQ:";
add after:
$lang['user_emailupload'] = "Adresse für eMail-Upload:";
$lang['user_emailupload_cat'] = "Kategorie für eMail-Upload:";



step 6) in /lang/xxx/admin.php
search for:
$lang['field_homepage'] = "Homepage";
add after:
$lang['field_emailupload_active'] = "eMailupload";
$lang['field_user_emailupload'] = "eMail für Mailupload";
$lang['field_user_emailupload_cat'] = "Kategorie für Mailupload";



step 7) in /member.php
search for:
  $user_icq = (isset($HTTP_POST_VARS['user_icq'])) ? ((intval(trim($HTTP_POST_VARS['user_icq']))) ? intval(trim($HTTP_POST_VARS['user_icq'])) : "") : "";
add after:
  $user_emailupload = (isset($HTTP_POST_VARS['user_emailupload'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_emailupload'])) : "";
  
$user_emailupload_cat = (isset($HTTP_POST_VARS['user_emailupload_cat'])) ? ((intval(trim($HTTP_POST_VARS['user_emailupload_cat']))) ? intval(trim($HTTP_POST_VARS['user_emailupload_cat'])) : "") : "";


step 7.1) in /member.php
search for:
    $sql "UPDATE ".USERS_TABLE."
            SET "
.get_user_table_field("""user_email")." = '$user_email', ".get_user_table_field("""user_showemail")." = $user_showemail, ".get_user_table_field("""user_allowemails")." = $user_allowemails, ".get_user_table_field("""user_invisible")." = $user_invisible, ".get_user_table_field("""user_homepage")." = '$user_homepage', ".get_user_table_field("""user_icq")." = '$user_icq'".$additional_sql."

replace with:
    $sql "UPDATE ".USERS_TABLE."
	
    SET "
.get_user_table_field("""user_email")." = '$user_email', ".get_user_table_field("""user_showemail")." = $user_showemail, ".get_user_table_field("""user_allowemails")." = $user_allowemails, ".get_user_table_field("""user_invisible")." = $user_invisible, ".get_user_table_field("""user_homepage")." = '$user_homepage', ".get_user_table_field("""user_emailupload")." = '$user_emailupload',  ".get_user_table_field("""user_emailupload_cat")." = '$cat_id',".get_user_table_field("""user_icq")." = '$user_icq'".$additional_sql."


step 7.2) in /member.php
search for:
  $site_template->register_vars(array(
    
"user_name" => format_text(stripslashes($user_name), 2),
    
"user_email" => format_text(stripslashes($user_email), 2),
    
"user_email2" => format_text(stripslashes($user_email2), 2),
    
"user_homepage" => format_text(stripslashes($user_homepage), 2),
    
"user_icq" => $user_icq,

replace with:
  $site_template->register_vars(array(
    
"cat_name" => get_category_dropdown_upload($user_emailupload_cat),
    
"user_name" => format_text(stripslashes($user_name), 2),
    
"user_email" => format_text(stripslashes($user_email), 2),
    
"user_email2" => format_text(stripslashes($user_email2), 2),
    
"user_homepage" => format_text(stripslashes($user_homepage), 2),
    
"user_icq" => $user_icq,
    
"user_emailupload" => format_text(stripslashes($user_emailupload), 2),
    
"user_emailupload_cat" => $user_emailupload_cat,


step 7.3) in /member.php
search for:
    "lang_icq" => $lang['icq'],
add after:
    "lang_user_emailupload" => $lang['user_emailupload'],
    
"lang_user_emailupload_cat" => $lang['user_emailupload_cat'],



step 8) in /templates/xxx/member_editprofile.html
search for:
          <tr
            <
td class="row2"><b>{lang_icq}</b></td>
            <
td class="row2"
              <
input type="text" name="user_icq"  size="30" value="{user_icq}" class="input" />
            </
td>
          </
tr>

add after:
          <tr
	
	
  
	
    <
td class="row1"><b>{lang_user_emailupload}</b></td>
            <
td class="row1"
              <
input type="text" name="user_emailupload"  size="100" value="{user_emailupload}" class="input" />
            </
td>
          </
tr>
	

          <
tr
	
	
  
	
    <
td class="row1"><b>{lang_user_emailupload_cat}</b></td>
            <
td class="row1">{cat_name}</td>
          </
tr>


step 8.1) in /templates/xxx/member_editprofile.html
search for:
  <input type="hidden" name="action" value="updateprofile" />
add bevor:
  {if cat_id}<input type="hidden" name="user_emailupload_cat" value="{cat_id}" />{endif cat_id}

I've tested many configurations and i think, it works well. May i've to make the code include in eMail_upload.php mor nice ;-)

Please send your feedback here.

Regards,
Henry
« Last Edit: December 17, 2010, 02:28:32 PM by henary »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] auth_email for Pictures Email Upload V1.7.x
« Reply #1 on: December 14, 2010, 05:17:04 AM »
i'm not able to make the selection for category by dropdown-list - i've no idea to solve this by myself 

In admin/settings.php find:
// end of functions

Insert above:
function show_categorory_select($setting_name$setting_value)
{
	
global 
$cat_parent_cache$drop_down_cat_cache$lang;
	
$drop_down_cat_cache $cat_parent_cache;
	
echo 
"<select name=\"setting_item[".$setting_name."]\" class=\"categoryselect\">";
	
echo 
"<option value=\"0\">".$lang['select_category']."</option>";
	
echo 
"<option value=\"0\">-------------------------------</option>";
	
echo 
get_category_dropdown_bits((int)$setting_value);
	
echo 
"</select>";
}


Then you can use:
show_setting_row("noauth_mail_cat""show_categorory_select");
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] auth_email for Pictures Email Upload V1.7.x
« Reply #2 on: December 14, 2010, 09:52:27 AM »
Hello,

thank you v@no for providing code! I've found the solution for user dropdown by myself after your advice. May be, it's ok or if you want to make it smaller?

The post above is updated today. If you have the first version, please do step 1.1 and replace in same file settings.php:

search:
  show_setting_row("noauth_mail_cat");
replace:
  show_setting_row("noauth_mail_cat""show_categorory_select");
and add this:
function show_categorory_select($setting_name$setting_value)
{
 global 
$cat_parent_cache$drop_down_cat_cache$lang;
  
$drop_down_cat_cache $cat_parent_cache;
  echo 
"<select name=\"setting_item[".$setting_name."]\" class=\"categoryselect\">";
  echo 
"<option value=\"0\">".$lang['select_category']."</option>";
  echo 
"<option value=\"0\">-------------------------------</option>";
  echo 
get_category_dropdown_bits((int)$setting_value);
  echo 
"</select>";
}


But i need once again solution for the user_dropdown  :(

Enjoy,
Henry
« Last Edit: December 15, 2010, 05:08:21 PM by henary »

Offline kubiczek

  • Full Member
  • ***
  • Posts: 212
    • View Profile
    • Gross Peterwitz
Re: [MOD] auth_email for Pictures Email Upload V1.7.x
« Reply #3 on: December 14, 2010, 06:22:33 PM »
hallo,

habe es eingebaut und es kommt folgender fehler.

es funktioniert, nur wird der user nicht zugeordnet bei der freischaltung.




kann sein das es daran liegt das ich 2 galerien mit einer Datenbank?

in der "zweiten galerie" in der constants.php
Quote
define('USERS_TABLE', $table_prefix.'users');
ersetzen durch:
Quote
$table_prefix2 = "4images_";
define('USERS_TABLE', $table_prefix2.'users');

wobei du 4images_ ersetzen musst durch den tabellenpräfix, den du in der "ersten tabelle" genommen hast

« Last Edit: December 14, 2010, 07:18:58 PM by kubiczek »

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] auth_email for Pictures Email Upload V1.7.x
« Reply #4 on: December 14, 2010, 07:11:22 PM »
Hi,

Du hast den Code-Schnipsel von gestern gegen die Version von heute ersetzt, auch die Einträge im ACP vorgenommen?

Sieht so aus, als würde keine user_id an die SQL-Abfrage übergeben werden.
Wenn Du phpmyadmin hast, siehe doch mal die drei Einträge in der settigs-tabelle an.

Ich mache mal ein Update der Anwendungsbeschreibung oben  :wink:

Bis gleich,
Henry

Offline kubiczek

  • Full Member
  • ***
  • Posts: 212
    • View Profile
    • Gross Peterwitz
Re: [MOD] auth_email for Pictures Email Upload V1.7.x
« Reply #5 on: December 14, 2010, 07:22:14 PM »
hallo,

habe es eingebaut und es kommt folgender fehler.

es funktioniert, nur wird der user nicht zugeordnet bei der freischaltung.




kann sein das es daran liegt das ich 2 galerien mit einer Datenbank?

in der "zweiten galerie" in der constants.php
Quote
define('USERS_TABLE', $table_prefix.'users');
ersetzen durch:
Quote
$table_prefix2 = "4images_";
define('USERS_TABLE', $table_prefix2.'users');

wobei du 4images_ ersetzen musst durch den tabellenpräfix, den du in der "ersten tabelle" genommen hast


hallo habe meinen post geändert.   habe alles so gemacht wie du beschrieben hast.

kann es sein das es daran liegt, das ich zwei gallerien mit einer datenbank betreibe?

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] auth_email for Pictures Email Upload V1.7.x
« Reply #6 on: December 14, 2010, 07:28:02 PM »
Hallo,

hallo habe meinen post geändert.   habe alles so gemacht wie du beschrieben hast.

kann es sein das es daran liegt, das ich zwei gallerien mit einer datenbank betreibe?

könnte, denn die Frage ist ja nun, in welcher DB sind die Einträge in der settings-Tabelle angelegt worden  :wink:

Wenn Du mit phpmyadmin diesen Code
Code: [Select]
INSERT INTO `4images_settings` (`setting_name`, `setting_value`) VALUES ('noauth_mail', ''), ('noauth_mail_cat', ''), ('noauth_mail_user', '');ausführen läßt, dann wähle im phpmyadmin die korrekte DB aus oder lege es eben in beiden an, auch egal.

EDIT: ODER hast Du eine DB, aber darin arbeitest Du mit zwei Präfixen? Nach nochmaligem lesen komme ich auf diesen Ansatz.  :?
Dann müßtest Du natürlich den Präfix 4images in der SQL-Zeile so ändern, daß es der richtige ist. Gib doch sonst mal den Auszug der betreffenden Zeilen der constants.php her.

Komisch, weil Du IMO ohne die Tabelleneiträge schon eher einen Fehler bekommen müßtest, nämlich schon bei der "noauth_mail"-Abfrage.

Bis gleich,
Henry

EDIT
Ok, der Fehler ist gefunden: Mein Codeschnipsel für die Ermittlung des Users ist nicht korrekt. War mir nicht aufgefallen, weil ich einen Wert gesetzt hatte... aber das script in der settings.php schreibt nicht in die DB. Habe den Code oben angepaßt, so daß (wieder) nur die Eingabe einer Nummer für die User_ID in den settings möglich ist - so geht das zumindest erst mal ohne Fehlermeldung.

Hello v@no, please help again to solve the user-selection. I need same like category-dropdown  :wink:

Thanks a lot!
Henry
« Last Edit: December 15, 2010, 05:09:43 PM by henary »

Offline kubiczek

  • Full Member
  • ***
  • Posts: 212
    • View Profile
    • Gross Peterwitz
Re: [MOD] auth_email V 0.5 for Pictures Email Upload V1.7.x
« Reply #7 on: December 15, 2010, 10:20:09 PM »
Hallo,

I have install this mod on a new fresh 1.7.9 version

and I have this problem, when I klick on email_upload

1 Neue Nachrichten in pop3.kubiczek.org

DB Error
Bad SQL QuerySELECT user_iduser_name FROM 4images_users WHERE user_id =
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Nr
.
	
Username
	
Bild Name
	
Kategorie
	
Schlüsselwörter
	
Beschreibung
1
	
	
1IMAG0074
	
test
	
	
nbsp


You can me help?


Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] auth_email V 0.5 for Pictures Email Upload V1.7.x
« Reply #8 on: December 16, 2010, 09:20:11 AM »
Hello,
Hallo,

I have install this mod on a new fresh 1.7.9 version

and I have this problem, when I klick on email_upload

1 Neue Nachrichten in pop3.kubiczek.org

DB Error
Bad SQL QuerySELECT user_iduser_name FROM 4images_users WHERE user_id =
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Nr
.
	
Username
	
Bild Name
	
Kategorie
	
Schlüsselwörter
	
Beschreibung
1
	
	
1IMAG0074
	
test
	
	
nbsp


You can me help?


the reason is located in settings.php, in my second post i changed field user and categorie from number into selection list, but my code for selectionlist for userselect was not fine. The list was seen, but selected value did not set into setting-table.

I've changed the code above back to selection categorie by dropdown from v@no and only field to fill number for user  :|

If v@no or anybody out there provide the right code to have a selectionlist for userselect as well, i'll update to finalisize this  :mrgreen:

Thanks and Regards,
Henry

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] auth_email V 0.8 for Pictures Email Upload V1.7.x
« Reply #9 on: December 17, 2010, 01:05:44 PM »
Hello,

i've updated code in post #1 because i've included some new functions  :mrgreen:

Please help to solve some unfinished thinks:

- dropdownform in settings.php for user selection
- dropdownform in admin/user.php for category selection

Thanks!
Henry

 

Post your comments here