4images Forum & Community
4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: dynkan-maclaud on December 26, 2007, 03:37:47 PM
-
вот такая ситуация...
вот смотрите скрипт
выводит 5 изображение в столбик из галереи
<?php
define('ROOT_PATH', '/home/тыщ/пыц/sait.ru/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$num_images = 5;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_date
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
ORDER BY a.image_date DESC
LIMIT $num_images";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : "http://sait.ru/data/thumbnails/".$cat_id."/".$row['image_thumb_file'];
echo "<p align=\"left\"><a href=\"http://sait.ru/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Комментарии: $image_comments\n";
}
?>
вот так это выглядит:
(http://djs.do.am/4571.JPG)
а мне надо чтобы было так:
(http://djs.do.am/4571a.JPG)
и как вот это сделать???
как мне надо я сделал в паинте ;)
а что надо с крипте менять?? просто я этот скрипт инкладю на сайт тоесть
ob_start();
include("../sait.ru/random_more_pics.php");
$script = ob_get_contents();
ob_end_clean();
$content .= $script;
это для slaed cms
-
help
-
Hi,
wrong forum:
1: Problem with a custom template => post here in the thread from the template
2: Problem with standart templates => post here: http://www.4homepages.de/forum/index.php?board=12.0 (http://www.4homepages.de/forum/index.php?board=12.0)
3: Language: => in this thread: englis or german
KurtW
-
Excuse has translated through the interpreter
Such situation...
Look script
Deduces 5 images in column from gallery
<?php
define('ROOT_PATH', '/home/&#1090;&#1099;&#1097;/&#1087;&#1099;&#1094;/sait.ru/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$num_images = 5;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_date
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
ORDER BY a.image_date DESC
LIMIT $num_images";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : "http://sait.ru/data/thumbnails/".$cat_id."/".$row['image_thumb_file'];
echo "<p align=\"left\"><a href=\"http://sait.ru/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "&#1050;&#1086;&#1084;&#1084;&#1077;&#1085;&#1090;&#1072;&#1088;&#1080;&#1080;: $image_comments\n";
}
?>
So it looks:
(http://djs.do.am/4571.JPG)
And it is necessary that was so:
(http://djs.do.am/4571a.JPG)
And how it to make???
-
it is only a html problem... (o:
try this:
<?php
define('ROOT_PATH', '/home/&#38;#1090;&#38;#1099;&#38;#1097;/&#38;#1087;&#38;#1099;&#38;#1094;/sait.ru/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
$num_images = 5;
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_date
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
ORDER BY a.image_date DESC
LIMIT $num_images";
$result = $site_db->query($sql);
//start table
echo "<table><tr>";
while ($row = $site_db->fetch_array($result)){
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : "http://sait.ru/data/thumbnails/".$cat_id."/".$row['image_thumb_file'];
//make column
echo "<td>";
echo "<a href=\"http://sait.ru/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "&#38;#1050;&#38;#1086;&#38;#1084;&#38;#1084;&#38;#1077;&#38;#1085;&#38;#1090;&#38;#1072;&#38;#1088;&#38;#1080;&#38;#1080;: $image_comments\n";
echo "</td>";
}
echo "</tr></table>";
//end table
?>
-
To Acidgod
Respect
-
And why when I do(make)
ob_start();
include("../sait.ru/random_more_pics.php");
$script = ob_get_contents();
ob_end_clean();
$content .= $script;
It in slaed cms. the complete text of the block is those
<?php
if (!defined('BLOCK_FILE')) {
Header("Location: ../index.php");
exit;
}
$content = "<link rel=\"stylesheet\" href=\"http://prikolki.ru/templates/ald_vopus/style.css\" type=\"text/css\">";
$content = "<p align=\"center\">";
ob_start();
include("../gallery.prikolki.ru/random_more_pics.php");
$script = ob_get_contents();
ob_end_clean();
$content .= $script;
?>
He writes
Fatal error: Cannot redeclare class db in /home/removed.by.Nicky/data/www/removed.by.Nicky/includes/db_mysql.php on line 28
And writes it изза that that one more block but with a code there is used
<?php
if (!defined('BLOCK_FILE')) {
Header("Location: ../index.php");
exit;
}
$content = "<link rel=\"stylesheet\" href=\"http://prikolki.ru/templates/ald_vopus/style.css\" type=\"text/css\">";
$content = "<p align=\"center\">";
ob_start();
include("../gallery.prikolki.ru/new_pics_center.php");
$script = ob_get_contents();
ob_end_clean();
$content .= $script;
?>
How to clean(remove) this mistake?
-
delete:
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
-
delete:
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
спасибо, (Thanks)
-
he no Porn in your Signature Image, please.