Seite 8 von 11

Verfasst: 04.03.2004 21:38
von Bandito
Hallo Markus

Also:
a) alle album_xxxxx.php liegen im phpBB2-Verzeichnis...
b) alle album_xxxxx_body.php liegen im /phpBB2/templates/subSilver
c) die portal_body.tpl liegt im /phpBB2/templates/subSilver
d) die portal.php im phpBB2-Verzeichnis

Bandito

P.S.
Ich verstehe es auch nicht, wieso des es die Bilder einfach nicht anzeigen will... :wink:

Verfasst: 04.03.2004 21:43
von Markus67
hi bandito ...

ich wurschtel mich hier gerade durch die suche ....

kriegen wir noch raus :-)

immer daran denken .... wir lernen was dabei :-)

markus

Verfasst: 04.03.2004 21:46
von Bandito
... die Suche hatte ich in den letzten Woche schon zig-Male benutzt. Jetzt weiss ich wenigstens, wie sie funktioniert... :grin:

Bandito

P.S.
Es liegt sicher an so einem winzig kleinen Scheiss! Wetten? :wink:

Verfasst: 04.03.2004 22:00
von Markus67
hi bandito :-)

klar ist es ne kleinigkeit ... :-)
hab einen neuen lösungsansatz ....

suche und ersetze in der portal.php

Code: Alles auswählen

// 
// BEGIN Random or Recent Photo 
// 

$Display = 'Recent';     // Replace 'XXXX' with 'Recent' or 'Random'. 
$CategoryID = 2;         // Replace 0 with a category ID.  Otherwise, keep it as it is. 
                         // Example: http://www.bandit600.ch/phpBB2/album_cat.php?cat_id=3 
                         // Category ID is 3 

if ($Display == 'Random') { 
   if ($CategoryID != 0) { 
      $sql = "SELECT * FROM phpbb_album WHERE pic_cat_id = $CategoryID ORDER BY RAND() LIMIT 1"; 
   } 
   else { 
      $sql = "SELECT * FROM phpbb_album ORDER BY RAND() LIMIT 1"; 
   } 
} 
else if ($Display == 'Recent') { 
   if ($CategoryID != 0) { 
      $sql = "SELECT pic_id, pic_title, pic_username, pic_time FROM phpbb_album WHERE pic_cat_id = $CategoryID ORDER BY pic_time DESC LIMIT 0,1"; 
   } 
   else { 
      $sql = "SELECT pic_id, pic_title, pic_username, pic_time FROM phpbb_album ORDER BY pic_time DESC LIMIT 0,1"; 
   } 
} 

if (!$result = $db->sql_query($sql)) 
   { 
   message_die(GENERAL_ERROR, 'Could not query album information', '', __LINE__, __FILE__, $sql); 
   } 
    
$picrow = $db->sql_fetchrow($result); 
// 
// END Random or Recent Photo 
//
ersetze mit

Code: Alles auswählen

// Get Newest Pic 
$sql = "SELECT * FROM ". ALBUM_CONFIG_TABLE; 
if(!$result = $db->sql_query($sql)) 
{ 
        message_die(GENERAL_ERROR, "Could not query album config information.", "", __LINE__, __FILE__, $sql); 
} 
while( $row = $db->sql_fetchrow($result) ) 
{ 
        $album_config_name = $row['config_name']; 
        $album_config_value = $row['config_value']; 
        $album_config[$album_config_name] = $album_config_value; 
} 

$sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments 
           FROM ". ALBUM_TABLE ." AS p 
                    LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id 
                    LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id 
                    LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id 
           WHERE  pic_approval = 1 
           GROUP BY p.pic_id ORDER BY pic_time DESC LIMIT 3"; 
if (!$result = $db->sql_query($sql)) 
{ 
        message_die(GENERAL_ERROR, 'Could not query album information.', '', __LINE__, __FILE__, $sql); 
} 
while ( $picrow = $db->sql_fetchrow($result) ) 
{ 
        if(!$picrow['rating']) 
        { 
                $picrow['rating'] = $lang['Not_rated']; 
        } 
        else 
        { 
                $picrow['rating'] = round($picrow['rating'], 2); 
        } 

        $pic_poster = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $picrow['pic_user_id']) .'">'. $picrow['pic_username'] .'</a>'; 

        $template->assign_block_vars('albumrow',   array( 
           'L_NEWEST_PIC' => $lang['Newest_pic'], 
           'PIC_IMAGE' => append_sid('album_thumbnail.'. $phpEx . '?pic_id=' . $picrow['pic_id']), 
           'U_PIC_LINK' => append_sid('album_page.' . $phpEx . '?pic_id=' . $picrow['pic_id']), 
           'L_PIC_TITLE' => $lang['Pic_Title'], 
           'L_VIEW' => $lang['View'], 
           'L_POSTER' => $lang['Poster'], 
           'L_POSTED' => $lang['Posted'], 
           'L_RATING' => $lang['Rating'], 
           'TITLE' => stripslashes($picrow['pic_title']), 
           'POSTER' => $picrow['username'], 
           'PIC_POSTER' => $pic_poster, 
           'TIME' => create_date($board_config['default_dateformat'], $picrow['pic_time'], $board_config['board_timezone']), 
           'VIEW' => $picrow['pic_view_count'], 
           'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. append_sid("album_rate.$phpEx?pic_id=". $picrow['pic_id']) . '">' . $lang['Rating'] . '</a> : ' . $picrow['rating'] . '<br />') : '', 
           'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid("album_comment.$phpEx?pic_id=". $picrow['pic_id']) . '">' . $lang['Comments'] . '</a> : ' . $picrow['comments'] . '<br />') : '', 
        )); 
} 

// END - Get Newest Pic

portal_body.tpl

suche und ersetze

Code: Alles auswählen

<!-- ##### SMARTOR PHOTO ADDON START ##### -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" align="center" class="forumline"> 
<tr> 
<th class="catleft" colspan="2" height="22" align="left"><span class="thCornerL"> {L_NEWEST_PIC}</a></span></th> 
</tr> 
<tr> 
<td class="row1" width="100%"> 
<span class="gensmall" style="line-height:150%"><br /><center><a href="{U_PIC_LINK}"><img src="{PIC_IMAGE}" border="0" alt="{L_NEWEST_PIC}"></a><br /><br /></span> 
</td> 
</tr> 
<tr> 
<td class="row1" width="100%"> 
<span class="gensmall" style="line-height:150%"><b>{PIC_TITLE}</b> by <b>{PIC_POSTER}</b><br />{PIC_TIME}</span> 
</td> 
</tr> 
<tr> 
<td class="row1" width="100%"> 
<span class="gensmall">[ <a href="{U_ALBUM}">{L_ALBUM}</a> ]</span> 
</td> 
</tr> 
</table>
<!-- ##### SMARTOR PHOTO ADDON ENDE ##### -->
ersetze mit

Code: Alles auswählen

<table border="0" align="center" cellspacing="1" cellpadding="1" class="forumline" width="100%"> 
  <tr> 
  <!-- BEGIN albumrow --> 
        <td align="left" valign="top" class="row2"> 
                <table border="0" align="center" cellspacing="1" cellpadding="1"> 
                  <tr> 
                        <td><span class="gensmall" style="line-height:150%"><a href="{albumrow.U_PIC_LINK}"><img src="{albumrow.PIC_IMAGE}" border="0"></a></span></td> 
                        <td><span class="gensmall"> 
                            {albumrow.L_PIC_TITLE}: {albumrow.TITLE}<br /> 
                            {albumrow.L_POSTER}: <b>{albumrow.PIC_POSTER}</b><br /> 
                            {albumrow.L_POSTED}: {albumrow.TIME}<br /> 
                            {albumrow.L_RATING}{albumrow.RATING} 
                            {albumrow.L_VIEW}: {albumrow.VIEW}</span></td> 
                  </tr> 
                  <tr> 
                        <td align="center" colspan="2"><span class="gensmall">{albumrow.COMMENTS}</span></td> 
                  </tr> 
                </table></td> 
  <!-- END albumrow --> 
  </tr> 
  <tr> 
        <td align="center" class="row1" colspan="4"><span class="gensmall">[ <a href="{U_ALBUM}">{L_ALBUM}</a> ]&nbsp;</span></td> 
  </tr> 
</table>
so mal scheuen was er jetzt sagt :-)

markus

Verfasst: 04.03.2004 22:10
von Bandito
... nur eine Zelle mit dem Gallery-Link zeigt er an. :roll:
Wieso funktioniert eigentlich immer dieser Link korrekt?

Bandito

Verfasst: 04.03.2004 22:22
von Markus67
...hi bandito .... hab noch was gefunden ....

für die portal.php

ersetze das was du vorhin eingesetzt hast mit dem hier

Code: Alles auswählen

// Get Newest Pic 
$sortby = 'last_pic' ; // Sort By Last Pic 
//$sortby = 'good_rate' ; // Sort by Good Average Vote 
//$sortby = 'time_rate' ; // Sort By rating et Last Time 

$sql = "SELECT * 
      FROM ". ALBUM_CONFIG_TABLE; 
if(!$result = $db->sql_query($sql)) 
{ 
   message_die(GENERAL_ERROR, "Could not query Album config information", "", __LINE__, __FILE__, $sql); 
} 
while( $row = $db->sql_fetchrow($result) ) 
{ 
   $album_config_name = $row['config_name']; 
   $album_config_value = $row['config_value']; 
   $album_config[$album_config_name] = $album_config_value; 
} 

$sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments 
FROM " . phpbb_album . " AS p 
LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id 
LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id 
LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id 
WHERE  pic_approval = 1 
GROUP BY p.pic_id "; 

if ($sortby == "last_pic") { 
$sql .= " ORDER BY pic_time DESC LIMIT 0,1"; 
} 
if ($sortby == "good_rate") { 
$sql .= " ORDER BY rating DESC LIMIT 0,1"; 
} 
if ($sortby == "time_rate") { 
$sql .= " ORDER BY rating DESC,pic_time DESC LIMIT 0,1"; 
} 

if (!$result = $db->sql_query($sql)) 
{ 
   message_die(GENERAL_ERROR, 'Could not query album information', '', __LINE__, __FILE__, $sql); 
} 

$picrow = $db->sql_fetchrow($result); 

if(!$picrow['rating']) 
            { 
               $picrow['rating'] = $lang['Not_rated']; 
            } 
            else 
            { 
               $picrow['rating'] = round($picrow['rating'], 2); 
            } 

$pic_poster = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $picrow['pic_user_id']) .'">'. $picrow['pic_username'] .'</a>'; 

$template->assign_vars(array( 
   'L_NEWEST_PIC' => $lang['Newest_pic'], 
   'PIC_IMAGE' => append_sid('album_thumbnail.'. $phpEx . '?pic_id=' . $picrow['pic_id']), 
   'U_PIC_LINK' => append_sid('album_page.' . $phpEx . '?pic_id=' . $picrow['pic_id']), 
   'L_PIC_TITLE' => $lang['Pic_Title'], 
   'L_VIEW' => $lang['View'], 
   'L_POSTER' => $lang['Poster'], 
   'L_POSTED' => $lang['Posted'], 
   'L_RATING' => $lang['Rating'], 
   'TITLE' => stripslashes($picrow['pic_title']), 
   'POSTER' => $picrow['username'], 
   'PIC_POSTER' => $pic_poster, 
   'TIME' => create_date($board_config['default_dateformat'], $picrow['pic_time'], $board_config['board_timezone']), 
   'VIEW' => $picrow['pic_view_count'], 
   'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. append_sid("album_rate.$phpEx?pic_id=". $picrow['pic_id']) . '">' . $lang['Rating'] . '</a> : ' . $picrow['rating'] . '<br />') : '', 
   'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid("album_comment.$phpEx?pic_id=". $picrow['pic_id']) . '">' . $lang['Comments'] . '</a> : ' . $picrow['comments'] . '<br />') : '', 
)); 

// END - Get Newest Pic
und du bist sicher dass in der datenbank deine ganzen tabellen den
präfix phpbb_ haben ?
nicht eventuell phpbb2 oder so was ähnliches ....

ich verstehs auch langsam nicht mehr woran das liegt .... bei mir läufts ....

markus

Verfasst: 04.03.2004 22:42
von Bandito
... versuche es mal bei dir mit diesen Codes:

Im portal.php ersetzen mit

Code: Alles auswählen

// SWITCH ALBUMPICS START 
if( $introportalmod_config['albumpics_active'] == "1" ) 
{ 
// PHP CODE START 

include($album_root_path . 'album_common.'.$phpEx); 

$cat_id = 1; 
$start = 0; 
$pics_per_page = 4; 


   $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, p.pic_lock, p.pic_approval, u.user_id, u.username 
         FROM ". ALBUM_TABLE ." AS p 
         LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id 
         WHERE p.pic_cat_id = '$cat_id' 
         GROUP BY p.pic_id 
         ORDER BY p.pic_time DESC 
         LIMIT 0,12"; 
   if( !($result = $db->sql_query($sql)) ) 
   { 
      message_die(GENERAL_ERROR, 'Could not query pics information', '', __LINE__, __FILE__, $sql); 
   } 

   $picrow = array(); 

   while( $row = $db->sql_fetchrow($result) ) 
   { 
      $picrow[] = $row; 
   } 


   for ($i = 0; $i < count($picrow); $i += 3) 
   { 
      $template->assign_block_vars('picrow', array()); 

      for ($j = $i; $j < ($i + 3); $j++) 
      { 
         if( $j >= count($picrow) ) 
         { 
            break; 
         } 

         $template->assign_block_vars('picrow.piccol', array( 
            'U_PIC' => append_sid("album_page.$phpEx?pic_id=". $picrow[$j]['pic_id']), 
            'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $picrow[$j]['pic_id']), 
            'DESC' => $picrow[$j]['pic_desc'], 
            ) 
         ); 

         $pic_poster = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $picrow[$j]['user_id']) .'">'. $picrow[$j]['username'] .'</a>'; 

         $template->assign_block_vars('picrow.pic_detail', array( 
            'TITLE' => $picrow[$j]['pic_title'], 
            ) 
         ); 
      } 
   } 

$sql = "SELECT count(pic_id) as entries 
      FROM ". ALBUM_TABLE . " 
      WHERE pic_cat_id = '$cat_id'"; 

if ( !($result = $db->sql_query($sql)) ) 
{ 
   message_die(GENERAL_ERROR, 'Could not query total entries.', '', __LINE__, __FILE__, $sql); 
} 
$total = $db->sql_fetchrow($result); 

$template->assign_vars(array( 
   'U_MORE_PICS_1' => ($total['entries'] > 4) ? '<a href="'. append_sid("album_cat.$phpEx?cat_id=". $cat_id) .'">'. $lang['more_pics'] .'</a>' : '', 
)); 
  
// PHP CODE END 
$template->assign_block_vars('switch_albumpics_active', array( 
$template->assign_vars(array( 
// TEMPLATE CODE VARS START 
'ALBUMPICS1' => $lang['albumpics1'], 
'ALBUMPICS2' => $lang['albumpics2'] 
// TEMPLATE CODE VARS END 
)) 
)); 
} 
// SWITCH ALBUMPICS END 
und in der portal_body.tpl

Code: Alles auswählen

<!-- ##### ALBUMPICS START ##### --> 
<!-- BEGIN switch_albumpics_active --> 
<table width="100%" border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse" class="forumline"> 
<tr> 
<td class="catHead" colspan="2" height="25"><span class="cattitle"> 
{ALBUMPICS1}: 
</span></td> 
</tr> 
<tr> 
<td colspan="2" height="1" class="row3"><img src="images/spacer.gif" width="1" height="1" alt="."></td> 
</tr> 
<tr> 
<td align="center" nowrap="nowrap" class="row1"><span class="gensmall"> 
<!-- CODE --> 
        <!-- BEGIN no_pics --> 
        <tr> 
         <td class="row1" align="center" height="50"><span class="gen">{L_NO_PICS}</span></td> 
        </tr> 
        <!-- END no_pics --> 
        <!-- BEGIN picrow --> 
        <tr> 
        <!-- BEGIN piccol --> 
         <td align="center" width="{S_COL_WIDTH}" class="row1"><span class="genmed"><a href="{picrow.piccol.U_PIC}" {TARGET_BLANK}><img src="{picrow.piccol.THUMBNAIL}" border="0" alt="{picrow.piccol.DESC}" title="{picrow.piccol.DESC}" vspace="10" /></a><br />{picrow.piccol.APPROVAL}</span></td> 
        <!-- END piccol --> 
        </tr> 
        <tr> 
        <!-- BEGIN pic_detail --> 
         <td class="row2"><span class="gensmall"> 
         {picrow.pic_detail.TITLE}<br /> 
         </td> 
        <!-- END pic_detail --> 
        </tr> 
        <!-- END picrow --> 
         </td> 
        </tr> 
<!-- CODE --> 
</span></td> 
</tr> 
</table> 
<!-- END switch_albumpics_active --> 
<!-- ##### ALBUMPICS END ##### --> 
Wie schauts dann bei dir aus!

Bandito

Verfasst: 04.03.2004 22:48
von Markus67
... das funzt nicht bei mir ....

totale fehlanzeige ....

ich glaube fast mit dem ersten waren wir am nächsten dran ....

ich mach mich nochmal auf die suche ....

markus

Verfasst: 04.03.2004 22:59
von Markus67
probier doch mal meine beiden dateien

http://www.westieforum.de/testdata/portal.txt
http://www.westieforum.de/testdata/portal_body.txt

mal sehen was dann passiert

markus

Verfasst: 04.03.2004 23:11
von Bandito
... ich habe deine Files jetzt hochgeladen. Also irgendwo muss bei mir etwas nicht stimmen, denn auch bei deinen Files werden die Bilder aus dem Album nicht angezeigt(?). :evil:
Im Übrigen sind bei der phpmyadmin alles auf phpbb_xxxxx.

MfG
Bandito