Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - piczilla

Pages: [1]
1
Mods & Plugins (Releases & Support) / Re: [MOD] Facebook Connector V1.0
« on: August 03, 2010, 02:15:23 AM »
Hey,

I have an idea. I don't know if it will be hard to integrate, but here it goes:

I have tons of friends on facebook that upload their photography through there. I was wondering if there was a way for them to connect with my site and transfer their images over to my site. Is that possible?

Coulton

2
The design of your page is messed up.
You need to go in and clean allot of things up...
just what I saw was that you places some of the javascript stuff in more then once and in the wrong area...

other things that I do not normally see on sites is that you have your <css> styles and a <table> command all coming before your <html> command.
most pages start with
<html>
<head> this is where you meta and javascripts should reside except for the one that has the fb-root it needs to be at the top of your body
</head>
<body> which is where your table should begin and the rest of your page stuff
</body>
</html>


I am getting the login button on my browser but nothing happens when I press it.
I see there is also a login button in your comment area through that app, not sure how it will interact with the mod.

but I would start be cleaning everything up and/or starting over with a fresh copy of your template that you are using...

If you give me a link to the template you are using, I may have time later this week to look at it but am getting off the computer for tonight.

UPDATE:
I think you need to remove this code from your page to get it to work correctly...
Code: [Select]
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({appId: '<<REMOVED FOR SECURITY>>', status: true, cookie: true, xfbml: true});
  FB.Event.subscribe('auth.sessionChange', function(response) {
    if (response.session) {
      // A user has logged in, and a new cookie has been saved
    } else {
      // The user has logged out, and the cookie has been cleared
    }
  });
</script>

This is the one in your <HEAD></HEAD> area...
I think it is conflicting with this mod. I believe it was installed when you added your comments from facebook.
My mod should accomplish the same thing and your comments should still work.

Let me know if you are still having troubles.


Thanks for everything. I actually uploaded the back-ups, cleaned the code out a bit, then redid the mod and it worked. And as for the comments, I am going to remove it and add the comments that came with 4images using the facebook profile picture mod. The only reason I used facebook comments in the first place is because the profile pictures.

Thanks again,
Coulton

3
Just did, now the facebook logout button shows all the time whether logged in or not and does not work.

4
Thanks! Installed it and now it's starting to act funny. The login to facebook button doesn't appear and the logout doesn't want to work. Thoughts?

Thanks,
Coulton

PS: here is the link http://insanestream.com/piczilla/

5
Yes, facebook's website for developers is very hard to understand...

My question to you is, what error? :?:
it looks like it placed the fields into your database correctly...

The same error I got before I added the stuff in the database.

ALTER TABLE `4images_users` ADD `fb_userid` VARCHAR(255) NOT NULL, ADD `fl_facebook` ENUM(\'new\',\'normal\',\'registered\') NOT NULL DEFAULT \'registered\'

I even emptied my cache and tried it in a different browser.

6
Okay,

I looked all over facebook developers how to do this. Then I realized I could look at the forums. I was so glad when I found it!
One problem, I get the error below

"ALTER TABLE `4images_users` ADD `fb_userid` VARCHAR(255) NOT NULL, ADD `fl_facebook` ENUM(\'new\',\'normal\',\'registered\') NOT NULL DEFAULT \'registered\'"

I added it in phpmyadmin with the correct specs, but it keeps giving me this error! I attached a screenshot of what my phpmyadmin looks like.

Thanks,
Coulton


7
Mods & Plugins (Releases & Support) / Re: [MOD] multiupload
« on: July 07, 2010, 09:00:14 PM »
Welcome to 4images forum.

Please post contents of your member_multiuploadform.html template

And check steps for members.php

Thanks for the help.

member_multiuploadform.html
Code: [Select]
<style type="text/css">
<!--
.style12 {color: #666666}
.style14 {color: #666666; font-size: 14px; }
.style15 {font-size: 14px}

-->
</style>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="47"><img src="http://www.insanestream.com/piczilla/templates/default_960px/images/divide_12_title.png" width="200" height="47" /> </td>
          </tr>
</table></td>
      </tr>
    </table></td>
  </tr>
</table>



<table width="960" border="0" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td valign="top" class="head1">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" class="head1">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" class="head1"><form method="post" action="{url_member}" enctype="multipart/form-data" onSubmit="uploadbutton.disabled=true;">
      <span class="row1 style12"><b>You are uploading these pictures to {cat_name}</b>.</span>
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td valign="top" class="head1"><table width="100%" border="0" cellpadding="4" cellspacing="0">
         
         
          <tr>
            <td width="38%" valign="top" class="row2"><span class="smalltext"><br />
              </span> </td>
            <td width="34%" class="row2">&nbsp;</td>
            <td width="28%" class="row2">&nbsp;</td>
          </tr>
          <tr>
            <td valign="top" class="row1"><table border="0" cellpadding="15" cellspacing="0" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/1.png); border:1px solid #dcdbdb;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                      <b>
                      <input name="media_file" type="file" class="input" />
                      </b></nobr><br>
                      <br>
                      <span class="style14"><b>{lang_image_name}</b></span><span class="row2"><b><br>
                                            </b>
                      <input type="text" name="image_name"  size="30" value="{image_name}" class="input" />
                      <br>
                      <br>
                      <b class="style14">{lang_description}</b> <br>
                      <textarea name="image_description" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                                            </span><br>
                      <br>
                      <span class="style14"><b>{lang_keywords}</b></span><span class="row2"><b><br>
                      </b>
                      <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords">{image_keywords}</textarea>
                                            </span><br>
                </b></td>
              </tr>
            </table>             
              <br></td>
            <td valign="top" class="row1"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/2.png);  border: 1px solid #d5d3d3;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file2" type="file" class="input" id="media_file2" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><span class="row2"><b><br>
                                                </b>
                        <input type="text" name="image_name2"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description2" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                                                </span><br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><span class="row2"><b><br>
                                                </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords2">{image_keywords}</textarea>
                                                </span><br>
                </b></td>
              </tr>
            </table>
              <br></td>
            <td valign="top" class="row1"><table border="0" cellspacing="0" cellpadding="15"  style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/1.png); border:1px solid #dcdbdb;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file3" type="file" class="input" id="media_file3" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><span class="row2"><b><br>
                                                </b>
                        <input type="text" name="image_name3"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description3" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                                                </span><br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><span class="row2"><b><br>
                                                </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords3">{image_keywords}</textarea>
                                                </span><br>
                </b></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="35" valign="top" class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
          </tr>
          <tr>
            <td valign="top" class="row2"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/2.png);  border: 1px solid #d5d3d3;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file4" type="file" class="input" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><b><br>
                        </b>
                        <input type="text" name="image_name4"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description4" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                        <br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><b><br>
                        </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords4">{image_keywords}</textarea>
                        <br>
                </b></td>
              </tr>
            </table></td>
            <td class="row2"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/1.png); border:1px solid #dcdbdb;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file15" type="file" class="input" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><b><br>
                        </b>
                        <input type="text" name="image_name5"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description5" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                        <br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><b><br>
                        </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords5">{image_keywords}</textarea>
                        <br>
                </b></td>
              </tr>
            </table></td>
            <td class="row2"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/2.png);  border: 1px solid #d5d3d3;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file16" type="file" class="input" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><b><br>
                        </b>
                        <input type="text" name="image_name6"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description6" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                        <br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><b><br>
                        </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords6">{image_keywords}</textarea>
                        <br>
                </b></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="35" valign="top" class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
          </tr>
          <tr>
            <td valign="top" class="row2"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/1.png); border:1px solid #dcdbdb;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file7" type="file" class="input" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><b><br>
                        </b>
                        <input type="text" name="image_name7"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description7" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                        <br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><b><br>
                        </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords7">{image_keywords}</textarea>
                        <br>
                </b></td>
              </tr>
            </table></td>
            <td class="row2"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/2.png);  border: 1px solid #d5d3d3;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file8" type="file" class="input" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><b><br>
                        </b>
                        <input type="text" name="image_name8"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description8" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                        <br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><b><br>
                        </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords8">{image_keywords}</textarea>
                        <br>
                </b></td>
              </tr>
            </table></td>
            <td class="row2"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/1.png); border:1px solid #dcdbdb;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file9" type="file" class="input" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><b><br>
                        </b>
                        <input type="text" name="image_name9"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description9" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                        <br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><b><br>
                        </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords9">{image_keywords}</textarea>
                        <br>
                </b></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="35" valign="top" class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
          </tr>
          <tr>
            <td valign="top" class="row2"><table border="0" cellspacing="0" cellpadding="15" style="background-image: url(http://www.insanestream.com/piczilla/templates/default_960px/images/2.png);  border: 1px solid #d5d3d3;">
              <tr>
                <td><b><nobr><span class="style14"><b>Upload</b><b></b></span><br>
                        <b>
                        <input name="media_file10" type="file" class="input" />
                        </b></nobr><br>
                        <br>
                        <span class="style14"><b>{lang_image_name}</b></span><b><br>
                        </b>
                        <input type="text" name="image_name10"  size="30" value="{image_name}" class="input" />
                        <br>
                        <br>
                        <b class="style14">{lang_description}</b> <br>
                        <textarea name="image_description10" cols="30" class="textarea" rows="5" wrap="VIRTUAL">{image_description}</textarea>
                        <br>
                        <br>
                        <span class="style14"><b>{lang_keywords}</b></span><b><br>
                        </b>
                        <textarea cols="30" class="textarea" rows="5" wrap="VIRTUAL" name="image_keywords10">{image_keywords}</textarea>
                        <br>
                </b></td>
              </tr>
            </table></td>
            <td class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
          </tr>
          <tr>
            <td valign="top" class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
            <td class="row2">&nbsp;</td>
          </tr>
         
         
         
          {if captcha_multiupload}
          <tr>
            <td class="row1" valign="top"><b><span class="style14">{lang_captcha}</span><br>
              <br>
              <a href="javascript:new_captcha_image();"><img src="{url_captcha_image}" border="0" id="captcha_image" /></a> <br />
                  <input type="text" name="captcha" size="30" value="" class="commentinput" id="captcha_input" />
                  <br />
                  </b><span class="style15 style12">{lang_captcha_desc} </span></td>
            <td class="row1">&nbsp;</td>
            <td class="row1">&nbsp;</td>
          </tr>
          {endif captcha_multiupload}
        </table></td>
    </tr>
  </table>
  <p align="left">
    <br>
    <br>
    <input type="submit" name="multiuploadbutton" value="{lang_submit}" />
    <input type="reset" value="{lang_reset}" />
  </p>
</form></td>
  </tr>
</table>
<br>
<br>
<br>
<br>

I downloaded a fresh version of 4images to get the members.php file. I did everything that it said in the tutorial and now it's blank. Why?
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: member.php                                           *
 *        Copyright: (C) 2002-2009 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.7                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) f&#252;r weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template "member";

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (
$action == "") {
  
$action "lostpassword";
}
$content "";
$txt_clickstream "";

$sendprocess 0;

if (isset(
$HTTP_GET_VARS[URL_COMMENT_ID]) || isset($HTTP_POST_VARS[URL_COMMENT_ID])) {
  
$comment_id = (isset($HTTP_GET_VARS[URL_COMMENT_ID])) ? intval($HTTP_GET_VARS[URL_COMMENT_ID]) : intval($HTTP_POST_VARS[URL_COMMENT_ID]);
}
else {
  
$comment_id 0;
}

if (
$action == "deletecomment") {
  if (!
$comment_id || ($config['user_delete_comments'] != && $user_info['user_level'] != ADMIN)) {
    
show_error_page($lang['no_permission']);
    exit;
  }

  
$sql "SELECT c.comment_id, c.user_id AS comment_user_id, i.image_id, i.cat_id, i.user_id, i.image_name
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  
$comment_row $site_db->query_firstrow($sql);
  if (!
$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    
show_error_page($lang['no_permission']);
    exit;
  }

  
$txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'], 2)."</a>".$config['category_separator'];
  
$txt_clickstream .= $lang['comment_delete'];

  
$sql "UPDATE ".IMAGES_TABLE."
          SET image_comments = image_comments - 1
          WHERE image_id = "
.$comment_row['image_id'];
  
$site_db->query($sql);

  if (
$comment_row['comment_user_id'] != GUEST) {
    
$sql "UPDATE ".USERS_TABLE."
            SET "
.get_user_table_field("""user_comments")." = ".get_user_table_field("""user_comments")." - 1
            WHERE "
.get_user_table_field("""user_id")." = ".$comment_row['comment_user_id'];
    
$site_db->query($sql);
  }

  
$sql "DELETE FROM ".COMMENTS_TABLE."
          WHERE comment_id = 
$comment_id";
  
$result $site_db->query($sql);
  
$msg = ($result) ? $lang['comment_delete_success'] : $lang['comment_delete_error'];
}

if (
$action == "removecomment") {
  if (!
$comment_id || ($config['user_delete_comments'] != && $user_info['user_level'] != ADMIN)) {
    
redirect($url);
  }

  
$sql "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.""user_name")."
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  
$comment_row $site_db->query_firstrow($sql);
  if (!
$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    
redirect($url);
  }

  
$txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'], 2)."</a>".$config['category_separator'];
  
$txt_clickstream .= $lang['comment_delete'];

  if (isset(
$comment_row[$user_table_fields['user_name']]) && $comment_row['comment_user_id'] != GUEST) {
    
$user_name $comment_row[$user_table_fields['user_name']];
  }
  else {
    
$user_name $comment_row['comment_user_name'];
  }

  
$site_template->register_vars(array(
    
"comment_id" => $comment_id,
    
"image_name" => format_text($comment_row['image_name']),
    
"user_name" => format_text($user_name),
    
"comment_headline" => format_text($comment_row['comment_headline'], 0$config['wordwrap_comments'], 00),
    
"comment_text" => format_text($comment_row['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
    
"lang_delete_comment" => $lang['comment_delete'],
    
"lang_delete_comment_confirm" => $lang['comment_delete_confirm'],
    
"lang_image_name" => $lang['image_name'],
    
"lang_name" => $lang['name'],
    
"lang_headline" => $lang['headline'],
    
"lang_comment" => $lang['comment'],
    
"lang_submit" => $lang['submit'],
    
"lang_reset" => $lang['reset'],
    
"lang_yes" => $lang['yes'],
    
"lang_no" => $lang['no']
  ));
  
$content $site_template->parse_template("member_deletecomment");
}

if (
$action == "updatecomment") {
  if (!
$comment_id || ($config['user_edit_comments'] != && $user_info['user_level'] != ADMIN)) {
    
show_error_page($lang['no_permission']);
    exit;
  }
  
$sql "SELECT c.comment_id, c.image_id, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.""user_name")."
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  
$comment_row $site_db->query_firstrow($sql);
  if (!
$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    
show_error_page($lang['no_permission']);
    exit;
  }

  
$txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'], 2)."</a>".$config['category_separator'];
  
$txt_clickstream .= $lang['comment_edit'];

  
$error 0;

  
$comment_headline un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
  
$comment_text un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

  if (
$comment_headline == "")  {
    
$error 1;
    
$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['headline']), $lang['field_required']);
    
$msg .= (($msg != "") ? "<br />" "").$field_error;
  }
  if (
$comment_text == "")  {
    
$error 1;
    
$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['comment']), $lang['field_required']);
    
$msg .= (($msg != "") ? "<br />" "").$field_error;
  }

  if (!
$error) {
    
$sql "UPDATE ".COMMENTS_TABLE."
            SET comment_headline = '
$comment_headline', comment_text = '$comment_text'
            WHERE comment_id = 
$comment_id";
    
$result $site_db->query($sql);
    
$msg = ($result) ? $lang['comment_edit_success'] : $lang['comment_edit_error'];
  }
  else {
    
$action "editcomment";
    
$sendprocess 1;
  }
}

if (
$action == "editcomment") {
  if (!
$comment_id || ($config['user_edit_comments'] != && $user_info['user_level'] != ADMIN)) {
    
redirect($url);
  }

  
$sql "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.""user_name")."
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  
$comment_row $site_db->query_firstrow($sql);
  if (!
$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    
header("Location: ".$site_sess->url($url"&"));
    exit;
  }

  
$txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'], 2)."</a>".$config['category_separator'];
  
$txt_clickstream .= $lang['comment_edit'];

  
$comment_headline = (isset($HTTP_POST_VARS['comment_headline'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_headline']))) : $comment_row['comment_headline'];
  
$comment_text = (isset($HTTP_POST_VARS['comment_text'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_text']))) : $comment_row['comment_text'];

  if (isset(
$comment_row[$user_table_fields['user_name']]) && $comment_row['comment_user_id'] != GUEST) {
    
$user_name $comment_row[$user_table_fields['user_name']];
  }
  else {
    
$user_name $comment_row['comment_user_name'];
  }

  
$bbcode "";
  if (
$config['bb_comments'] == 1) {
    
$site_template->register_vars(array(
      
"lang_bbcode" => $lang['bbcode'],
      
"lang_tag_prompt" => $lang['tag_prompt'],
      
"lang_link_text_prompt" => $lang['link_text_prompt'],
      
"lang_link_url_prompt" => $lang['link_url_prompt'],
      
"lang_link_email_prompt" => $lang['link_email_prompt'],
      
"lang_list_type_prompt" => $lang['list_type_prompt'],
      
"lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    
$bbcode $site_template->parse_template("bbcode");
  }

  
$site_template->register_vars(array(
    
"bbcode" => $bbcode,
    
"comment_id" => $comment_id,
    
"image_name" => format_text($comment_row['image_name'], 2),
    
"user_name" => format_text($user_name2),
    
"comment_headline" => format_text($comment_headline2),
    
"comment_text" => format_text($comment_text2),
    
"lang_edit_comment" => $lang['comment_edit'],
    
"lang_image_name" => $lang['image_name'],
    
"lang_name" => $lang['name'],
    
"lang_headline" => $lang['headline'],
    
"lang_comment" => $lang['comment'],
    
"lang_submit" => $lang['submit'],
    
"lang_reset" => $lang['reset'],
    
"lang_yes" => $lang['yes'],
    
"lang_no" => $lang['no']
  ));
  
$content $site_template->parse_template("member_editcomment");
}

if (
$action == "deleteimage") {
  if (!
$image_id || ($config['user_delete_image'] != && $user_info['user_level'] != ADMIN)) {
    
show_error_page($lang['no_permission']);
    exit;
  }
  
$sql "SELECT image_id, cat_id, user_id, image_name, image_media_file, image_thumb_file
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  
$image_row $site_db->query_firstrow($sql);
  if (!
$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    
show_error_page($lang['no_permission']);
    exit;
  }

  
$txt_clickstream $lang['image_delete'];

  
$sql "DELETE FROM ".IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  
$del_img $site_db->query($sql);

  if (!
is_remote($image_row['image_media_file']) && !is_local_file($image_row['image_media_file'])) {
    @
unlink(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']);
  }
  if (!empty(
$image_row['image_thumb_file']) && !is_remote($image_row['image_thumb_file']) && !is_local_file($image_row['image_thumb_file'])) {
    @
unlink(THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file']);
  }

  include_once(
ROOT_PATH.'includes/search_utils.php');
  
remove_searchwords($image_id);

  if (!empty(
$user_table_fields['user_comments'])) {
    
$sql "SELECT user_id
            FROM "
.COMMENTS_TABLE."
            WHERE image_id = 
$image_id";
    
$result $site_db->query($sql);
    
$user_id_sql "";
    while (
$row $site_db->fetch_array($result)) {
      if (
$row['user_id'] != GUEST) {
        
$sql "UPDATE ".USERS_TABLE."
                SET "
.get_user_table_field("""user_comments")." = ".get_user_table_field("""user_comments")." - 1
                WHERE "
.get_user_table_field("""user_id")." = ".$row['user_id'];
        
$site_db->query($sql);
      }
    }
  }

  
$sql "DELETE FROM ".COMMENTS_TABLE."
          WHERE image_id = 
$image_id";
  
$del_com $site_db->query($sql);

  if (
$del_img) {
    
$msg $lang['image_delete_success'];
  }
  else {
    
$msg $lang['image_delete_error'];

8
Mods & Plugins (Releases & Support) / Re: [MOD] multiupload
« on: July 07, 2010, 05:43:01 PM »
Nothing like bring up an old topic  :D

I just followed this to get the multiple uploads to work. I also installed the thing to get different names, descriptions, and keywords.

The only problem is when I click "submit" it makes me to the members.php page and it says I have lost my password.

Can anyone help?

Thanks,
Coultonß

Pages: [1]