4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: helium on March 03, 2008, 05:06:07 AM

Title: [mod] Integration with phpbb3 Enjoy
Post by: helium on March 03, 2008, 05:06:07 AM
This mod integrates the users from phpbb3 forum software (http://www.phpbb.com) so that they can be used across 4images. You dont actualy have to modify any phpbb files only files within the 4images system.

This is just a quick mod i put together, it probably has a few bugs butt here is what the mod can and cant do.

Can
Can't


demo: http://liveanime.org/gallery/ / http://liveanime.org/forums/

Download the zip (http://liveanime.org/4images_integration_mod.zip)


[size=150]Installation Instructions[/size][/b]

First extract the zip folder somewhere and copy the session.php and constants.php files from there to "/4images_directory/includes/" and replace the session.php and constants.php files in there.

Find in "includes/functions.php":
Code: (php) [Select]
    $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'];
 
Replace with
Code: (php) [Select]
 $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : FORUM_ROOT_PATH."memberlist.php?mode=viewprofile&u=".$image_row['user_id'];
 
Find:
Code: (php) [Select]
  if (SHOW_RANDOM_CAT_IMAGE) {
    $sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
            FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            ORDER BY RAND()";
 
Replace With:
Code: (php) [Select]
  if (SHOW_RANDOM_CAT_IMAGE) {
    $sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.username_clean AS user_name
            FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            ORDER BY RAND()";
 
Find:
Code: (php) [Select]
    $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
            FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            LIMIT $number, 1";
    $random_image_cache[0] = $site_db->query_firstrow($sql);
 
Replace With:
Code: (php) [Select]
    $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.username_clean AS user_name
            FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            LIMIT $number, 1";
    $random_image_cache[0] = $site_db->query_firstrow($sql);
 

Find in "includes/page_header.php"
Code: (php) [Select]
"url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
 
Replace With
Code: (php) [Select]
  "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(FORUM_ROOT_PATH."ucp.php?mode=register"),
 
Find
Code: (php) [Select]
"url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(ROOT_PATH."member.php?action=editprofile"),
 
Replace With
Code: (php) [Select]
"url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(FORUM_ROOT_PATH."ucp.php"),
 
Find
Code: (php) [Select]
"url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
 
Replace
Code: (php) [Select]
 "url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(FORUM_ROOT_PATH."ucp.php?mode=logout&sid=".$user->data['session_id']),
 

OPEN "templates/your_template_dir/user_loginform.html" and replace it all with
Code: [Select]
<form action="<?php echo FORUM_ROOT_PATH?>ucp.php" method="post">
<input type="hidden" name="mode" value="login" />
User Name:<input type="text"  name="username" />
Password:<input type="password" name="password" />
Hidden:<input type="checkbox" class="radio" name="viewonline" />
<input type="hidden" name="autologin" value="1" />
<input type="submit" value="Submit" name="login" />
</form>

Find in top.php
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
 

Find:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 10";
 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 10";
 

Find:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 10";
 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 10";
 

Find:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_downloads DESC, i.image_name ASC
        LIMIT 10";

 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_downloads DESC, i.image_name ASC
        LIMIT 10";
 

Find in "search.php"
Code: (php) [Select]
  $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
          FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1
          $sql_where_query
          AND c.cat_id = i.cat_id $cat_id_sql
          ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
          LIMIT $offset, $perpage";
 
Replace With
Code: (php) [Select]
  $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name, u.username_clean AS user_name
          FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1
          $sql_where_query
          AND c.cat_id = i.cat_id $cat_id_sql
          ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
          LIMIT $offset, $perpage";
 


Find in "categories.php"
Code: (php) [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
        ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
        LIMIT $offset, $perpage";
 
Replace With:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
        ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
        LIMIT $offset, $perpage";
 

Find in lightbox.php
Code: (php) [Select]
  $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
          FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1 AND i.image_id IN ($image_id_sql) AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
          ORDER BY i.".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
          LIMIT $offset, $perpage";
 
Replace with:
Code: (php) [Select]
  $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name, u.username_clean AS user_name
          FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1 AND i.image_id IN ($image_id_sql) AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
          ORDER BY i.".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
          LIMIT $offset, $perpage";
 

Find in "includes/constants.php" and Replace the "phpbb_" with whatever your phpbb3 table prefix is. AND change the "../forums/" to wherever your forums are RELATIVLY from your gallery folder.
Code: (php) [Select]
$table_prefix = "phpbb_";
define('FORUM_ROOT_PATH', '../forums/');
 


Find in "includes/db_mysql.php"
Code: (php) [Select]
} // end of class
?>
ADD BEFORE
Code: (php) [Select]
  /////////////////////////////////////////////////////////
  ///                                                    ///
  ///            phpbb3 Integration Mod                    ///
  ///            Created by helium                        ///
  ///            http://www.liveanime.org                ///
  ///                                                    ///
  /////////////////////////////////////////////////////////
  
  
  
  
   function _sql_validate_value($var)
    {
        if (is_null($var))
        {
            return 'NULL';
        }
        else if (is_string($var))
        {
            return "'" . $this->sql_escape($var) . "'";
        }
        else
        {
            return (is_bool($var)) ? intval($var) : $var;
        }
    }
  
  
  function sql_build_array($query, $assoc_ary = false)
    {
        if (!is_array($assoc_ary))
        {
            return false;
        }

        $fields = $values = array();

        if ($query == 'INSERT' || $query == 'INSERT_SELECT')
        {
            foreach ($assoc_ary as $key => $var)
            {
                $fields[] = $key;

                if (is_array($var) && is_string($var[0]))
                {
                    // This is used for INSERT_SELECT(s)
                    $values[] = $var[0];
                }
                else
                {
                    $values[] = $this->_sql_validate_value($var);
                }
            }

            $query = ($query == 'INSERT') ? ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')' : ' (' . implode(', ', $fields) . ') SELECT ' . implode(', ', $values) . ' ';
        }
        else if ($query == 'MULTI_INSERT')
        {
            $ary = array();
            foreach ($assoc_ary as $id => $sql_ary)
            {
                // If by accident the sql array is only one-dimensional we build a normal insert statement
                if (!is_array($sql_ary))
                {
                    return $this->sql_build_array('INSERT', $assoc_ary);
                }

                $values = array();
                foreach ($sql_ary as $key => $var)
                {
                    $values[] = $this->_sql_validate_value($var);
                }
                $ary[] = '(' . implode(', ', $values) . ')';
            }

            $query = ' (' . implode(', ', array_keys($assoc_ary[0])) . ') VALUES ' . implode(', ', $ary);
        }
        else if ($query == 'UPDATE' || $query == 'SELECT')
        {
            $values = array();
            foreach ($assoc_ary as $key => $var)
            {
                $values[] = "$key = " . $this->_sql_validate_value($var);
            }
            $query = implode(($query == 'UPDATE') ? ', ' : ' AND ', $values);
        }

        return $query;
    }
  
  
  function sql_escape($msg)
    {
        if (!$this->db_connect_id)
        {
            return @mysql_real_escape_string($msg);
        }

        return @mysql_real_escape_string($msg, $this->db_connect_id);
    }
 

In "details.php" Find:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
 
Replace With:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name, u.username_clean AS user_name ".get_user_table_field(", u.", "user_email")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
 

Find
Code: (php) [Select]
    $user_name_field = get_user_table_field("", "user_name");
    if (!empty($user_name_field)) {
      if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
    }
 
Replace With
Code: (php) [Select]
    $user_name_field = 'username_clean';
    if (!empty($user_name_field)) {
      if ($site_db->not_empty("SELECT $user_name_field FROM ".pUSERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
    }
 

Find:
Code: (php) [Select]
  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date ASC";
 
Replace With:
Code: (php) [Select]
  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date, u.group_id AS user_level, u.username_clean AS user_name, u.user_email AS user_email, u.user_allow_viewemail AS user_showemail, u.user_allow_viewonline AS user_invisible, u.user_regdate AS user_joindate, u.user_lastvisit AS user_lastaction, u.user_posts AS user_comments, u.user_website AS user_homepage, u.user_icq
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date ASC";
 

Find:
Code: (php) [Select]
        $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
 
Replace:
Code: (php) [Select]
$comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(FORUM_ROOT_PATH."memberlist.php?mode=viewprofile&u=".$comment_user_id);
 

Find:
Code: (php) [Select]
if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          $comment_user_email = format_text($comment_row[$i][$user_table_fields['user_email']]);
          $comment_user_email_save = format_text(str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]));
          if (!empty($url_mailform)) {
            $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
          }
          else {
            $comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          $comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }
 

and delete it.

Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.
Code: [Select]
UPDATE `4images_images` SET `user_id` = '2';
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: maineyak on March 03, 2008, 01:58:35 PM
This is just what I was looking for, too bad I already have the SEO mod installed.  :cry:
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: mawenzi on March 03, 2008, 02:26:42 PM
... I moved it to Mods & Plugins (Releases & Support) ...
... but I have don't tested it ...
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: asshero on March 03, 2008, 10:00:57 PM
I'm sure there's a way to include the functions necessary for phpBB to reference user_id's in the database, whether anyone knows off the top of their head is another question. :p
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: matteo260 on March 06, 2008, 11:30:20 AM
Hi,

the integration works fine, with one big problem for me.

I lock in via my forum board. When I go to the 4images gallery, I appear locked in with my name.

But there is no "control-Panel" indication and I can`t lock in as an administrator. I only can look over the gallery like a guest can do.

If I try to open the ../admin/index.php a message appears in German that I`m not an administrator and that I have not locked in.

Any suggestions.

What about the "user levels" definitions in the constants.php? As there isn`t any part named "user_level" in the phpbb3_users any more, it doesn`t make sense.
If I change the guests user level in the constants.php to 9 (= my former admin level in phpbb2) I can lock in to the admin board. But now everybody can lock in as well as I tested it.

Regrets

Matthias Schäfer
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: matteo260 on March 11, 2008, 03:14:59 PM
Problem solved,

you have to check the group-ID in the database an put this in as user level.

Grüße

Matthias
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: spanky on April 13, 2008, 07:34:42 PM
I have set everything correct. I am stuck on the last part.
Code: [Select]
Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.
Code:

UPDATE `4images_images` SET `user_id` = '2';

Can someone help?


Eddie

Title: Help with phpbb3 Integration
Post by: spanky on April 21, 2008, 07:14:01 AM
I am trying to get 4Images current version integrated with phpbb 3.0.1. I am stuck. I don't know what this means.

Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.


Can someone help me with this?

Eddie
Title: Re: Help with phpbb3 Integration
Post by: asd.m on April 21, 2008, 09:41:37 AM
I'm not shore about what u should do

but

show me the page that u read this in and I can help u 
Title: Re: Help with phpbb3 Integration
Post by: spanky on April 21, 2008, 09:43:29 PM
http://www.4homepages.de/forum/index.php?topic=20742.0 (http://www.4homepages.de/forum/index.php?topic=20742.0)

I am stuck on the last part.

Eddie
Title: Re: Help with phpbb3 Integration
Post by: mawenzi on April 21, 2008, 09:54:10 PM
... and why you don't post in the related thread ... ?
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: spanky on April 21, 2008, 10:26:16 PM
I am trying to get 4Images current version integrated with phpbb 3.0.1. I am stuck. I don't know what this means.

Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.

Can someone help me with this?

Eddie
Title: Re: Help with phpbb3 Integration
Post by: asd.m on April 22, 2008, 12:52:17 AM
hello :)

if u didn't do any change in " $table_prefix "
that it's in config.php file in 4images
don't change any thing and do this sql
Code: [Select]
UPDATE `4images_images` SET `user_id` = '2';
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: Nicky on April 22, 2008, 10:44:50 AM
hello :)

if u didn't do any change in " $table_prefix "
that it's in config.php file in 4images
don't change any thing and do this sql
Code: [Select]
UPDATE `4images_images` SET `user_id` = '2';


Code: [Select]
UPDATE 4images_images SET user_id  = '2' where user_id = '1';
guest with -1 should be not updated..
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: spanky on April 23, 2008, 07:14:43 AM
I got that part worked put. When I loged out of the gallery I get a page not found error. I looked in the url and I see a FORUM_ROOT_PATH as part of the url.
I noticed that there is several edits in this script that has that. Do I cahnge all of them to my path or is there a certain file that I change the path?

Eddie
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: Tobi.L on June 06, 2008, 06:48:57 PM
Danke!
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: kashiyuka on June 11, 2008, 09:13:36 AM
Hello:
This is my first post here in 4images forum. I was trying to find a solution to integrate 4images and phpbb3, and found this miracle post here. It seems a great solution for me, but unfortunately I can't get it works as it should be.

Here are my steps:

1. install phpbb3 (3.0.1) in directory ../phpbb
2. install 4images (1.7.6) in directory ../gallery
3. follow every steps in the instruction including the last step "UPDATE `4images_images` SET `user_id` = '2';"
(I did it actually, and it affected nothing of course since the table "4images_images" contains nothing. )

Then I logged in phpbb3 as admininstrator, and then opened 4images main page. The error page is like:

An unexpected error occured. Please try again later. (x10 times)

Fatal error: Call to a member function acl_get() on a non-object in C:\wamp\www\4images\includes\sessions.php on line 2926

Please let me know where'd I go wrong. Thank you very much!


Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: siay on July 16, 2008, 01:56:42 AM
many bugs :) @helium, do you thing about work for upgrading version of this patch? its will be very fine for us :s thanks
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: SantaZ on August 03, 2008, 01:00:44 PM
hello and thx for this mod ,)


But I have a Problem. I changed all the files and I use PhPbb 3.0.2.

If I logged in I become this error message at the 4images Page and the Admin Page

Quote
INSERT INTO kfbgal_lightboxes (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids) VALUES ('a4a87edb9e11fa354c5a0995b01b1479', 2, 1217761079, '')


I use two phpBB Scripts and one database. To do that i chanced the constans.php like

Quote
define('STYLES_IMAGESET_TABLE',      $table_prefix . 'styles_imageset');
define('STYLES_IMAGESET_DATA_TABLE',$table_prefix . 'styles_imageset_data');
define('TOPICS_TABLE',            'orig_topics');
define('TOPICS_POSTED_TABLE',      'orig_topics_posted');


could that the problem ?
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: helium on August 11, 2008, 01:03:37 PM
Hey all, sorry for lack of support, I will be making a better solution fairly soon, hopefulyy by end of the week
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: darkcurves on August 18, 2008, 10:21:47 AM
That's great man! Hope to hear soon from you.  :D
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: siay on September 03, 2008, 12:09:30 AM
how is going on :)
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: helium on September 03, 2008, 07:45:59 PM
I have worked on the session management and is ALOT better and will need alot less code edits, all done by calling the phpbb session mangament and then mimiking/duplicating it to "simulate" the 4images system.

As i have started from the ground up this will basicly be an entirely new solution so i would recommend to all of you have (if any of you have actually managed to get it working) installed this version of the mod to unistall it (just do the steps in reverse :).. should be out soon, taking longer than i thought but you lot shouldn't have to wait too much longer.
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: Bob La Londe on September 03, 2008, 07:54:41 PM
Sounds exciting.  Looking forward to playing with the new version. 
Title: Re: [mod] Integration with phpbb3 Enjoy
Post by: airliner on September 01, 2009, 08:21:57 AM
Hello there,

Just tried this mod.

When I log in via my gallery's login form I get transferred directly to phpbb3's forum directory and I am logged in.

When I go to my gallery's URL I'm not, or so it seems. No Admin control panel or no signs of me beeing logged in.

I did all the necessery things told in the first post.

Please help.

Thanx in advance.