Вэб-разработка
Учим PHP

Dedof (off) [899]
14 февраля 2009, 13:15

вот преведу всё целиком:


<?php
define('IN_PHPBB', true);

$phpbb_root_path = './'; // <--
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
$inline_columns = 4;
$inline_rows = 5;
$window_columns = 8;

$userdata = session_pagestart($user_ip, $page_id);
init_userprefs($userdata);
$page_title = 'Последние комментарии к фото';
include($phpbb_root_path . 'config.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
'body' => 'fcomment.tpl'));

$mysql_host = "localhost";
$mysql_user = " ";
$mysql_password = " ";
$mysql_bd = " ";

$link = mysql_connect($mysql_host, $mysql_user, $mysql_password);
mysql_select_db($mysql_bd);




$sql=mysql_query("SELECT t.*, a.* FROM phpbb_album_comment t, phpbb_album a WHERE t.comment_pic_id = a.pic_id ORDER BY comment_id DESC LIMIT 50");
while($row=mysql_fetch_array($sql))

// вот видимо здесь вместо DESC LIMIT 50 должно быть . $start . ", " . $board_config['posts_per_page']; но с ним вообще не работает
{

$comment_text=$row[comment_text];
$comment_text = smilies_pass($comment_text);
$comment_username = $row[comment_username];
$pic_title=$row[pic_title];
$comment_pic_id=$row[comment_pic_id];
$comment_time=$row[comment_time];
$comment_time = strftime(" %d.%m %H:%M",$comment_time);
$pic_id=$row[pic_id];


$sql = "SELECT COUNT($comment_pic_id) as total FROM " . phpbb_album_comment;

if ( !($sqlult = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql);
}
$count = $db->sql_fetchrow($sqlult);
if ($count['total'] > $board_config['posts_per_page'])
{
$pagination = generate_pagination("fcomentt.$phpEx?", $count['total'], $board_config['posts_per_page'], $start);
}
-------

Назад в тему

Вэб-разработка
Список форумов
На главную

0.017 сек
SQL: 3