Witam zakupiłem skrypt w którym style opierają się na tagach i mam problem ponieważ chciałem zrobić dynamiczne meta i tak np w blogs_full.php działa tag subject oznacza nazwę notki a np w includowanym pliku _header_blogi.html tah {subject} już nie działa . można zobaczyć to tutaj
http://xol-live.pl/blogs_full.php?id=17tu podaję 3 pliki odpowiedzialne za to
blogs_full.php
<?php
/* (C) ABK-Soft Ltd., 2004-2006
IMPORTANT: This is a commercial software product
and any kind of using it must agree to the ABK-Soft
Ltd. license agreement.
It can be found at <a href=\"http://abk-soft.com/license.doc\" target=\"_blank\">http://abk-soft.com/license.doc</a>
This notice may not be removed from the source code. */
include("./_include/core/main_start.php");
payment_check('blogs_read');
if (isset($g['options']['blogs']) and
$g['options']['blogs'] == "N") redirect
('home.php');
class CBlog extends CHtmlBlock
{
function action()
{
$cmd = get_param("cmd", "");
if ($cmd == "comment")
{
if ($g_user['user_id'] == 0) redirect("join.php");
if (trim(get_param
("comment", "")) != "") {
DB::execute("
INSERT INTO blog_comment SET
msg_id=" . to_sql(get_param("id", ""), "Number") . ",
user_id=" . $g_user['user_id'] . ",
comment=" . to_sql(get_param("comment", ""), "Text") . ",
dt='" . date('Y-m-d H:i:s') . "'; ");
DB::execute("
UPDATE blog_msg SET count_comment=(count_comment+1)
WHERE id=" . to_sql(get_param("id", ""), "Number") . "
");
}
}
}
function parseBlock(&$html)
{
if ($g['options']['blogs'] == "Y")
{
$html->parse("my_blog", true);
}
else
{
redirect("home.php");
}
DB::query("
SELECT u.*, b.*, YEAR(FROM_DAYS(TO_DAYS('" . date('Y-m-d H:i:s') . "')-TO_DAYS(birth))) AS age FROM (blog_msg AS b LEFT JOIN user AS u ON u.user_id=b.user_id)
WHERE b.id=" . to_sql(get_param("id", ""), "Number") . "
");
if ($row = DB::fetch_row())
{
DB::query("
SELECT u.*, b.*, YEAR(FROM_DAYS(TO_DAYS('" . date('Y-m-d H:i:s') . "')-TO_DAYS(birth))) AS age FROM (blog_comment AS b LEFT JOIN user AS u ON u.user_id=b.user_id)
WHERE b.msg_id=" . to_sql(get_param("id", ""), "Number") . "
");
while ($row2 = DB::fetch_row())
{
foreach ($row2 as $k => $v)
{
$html->setvar($k, to_html($v));
}
$html->setvar("comment", to_html($row2['comment']));
$html->parse("comment", true);
}
foreach ($row as $k => $v)
{
$html->setvar($k, to_html($v));
}
$html->setvar("msg", to_html($row['msg']));
if ($row['image'] != "")
{
$html->setvar("image", $row['id'] . ".jpg");
$html->parse($this->m_name . "_image", false);
}
else
{
$html->setblockvar($this->m_name . "_image", "");
}
#$html->setvar("city_title", DB::result("SELECT city_title FROM geo_city WHERE city_id=" . $row['city_id'], 0, 2));
#$html->setvar("state_title", DB::result("SELECT state_title FROM geo_state WHERE state_id=" . $row['state_id'], 0, 2));
#$html->setvar("country_title", DB::result("SELECT country_title FROM geo_country WHERE country_id=" . $row['country_id'], 0, 2));
}
else
{
redirect("blogs.php");
}
parent::parseBlock($html);
}
}
$page = new CBlog("blogs_list", $g['tmpl']['dir_tmpl_main'] . "blogs_full.html");
$header = new CHeader("header_blogi", $g['tmpl']['dir_tmpl_main'] . "_header_blogi.html");
$page->add($header);
$footer = new CFooter("footer", $g['tmpl']['dir_tmpl_main'] . "_footer.html");
$page->add($footer);
$users_ims = new CIms("ims", $g['tmpl']['dir_tmpl_main'] . "_ims.html");
$page->add($users_ims);
include("./_include/core/main_close.php");
?>
blogs_full.html
{header_blogi}
{ims}
<div id="wide" class="box"><div class="bbt"><div class="bbb"><div class="bbl"><div class="bbr"><div class="bbtl"><div class="bbtr"><div class="bbbl"><div class="bbbr">
<div class=header_small style="float:left; margin-top:20px; margin-bottom:5px;">{subject}
</div>
<div style="float:right; margin-top:25px; margin-bottom:5px;"><a href="{url_main}search_results.php?name={name}"><b>{name}
</b></a> | {dt}
</div>
<table width="100%" border="0" class="blog_bg" style="clear:both;"><tr>
<td width="1" valign="top">
<div style="padding: 10px;">
<!-- begin_blogs_list_image -->
<img src="{url_files}blog/{image}" border="0" class="blog_photo">
<!-- end_blogs_list_image -->
<div style="padding: 5px; ">{msg}
</div>
<div align="right" class="blog_inf">
<a href="{url_main}blogs_view.php?id={user_id}" class="pri_little_bold">{l_view_blog}
</a>
<!-- begin_comment -->
<div class=header_small style="float:left; margin-top:20px; margin-bottom:5px;">{subject}
</div>
<div style="float:right; margin-top:25px; margin-bottom:5px;"><a href="{url_main}search_results.php?name={name}"><b>{name}
</b></a> | {dt}
</div>
<table width="100%" border="0" class="light" style="clear:both;"><tr>
<td width="1" valign="top">
<div style="padding: 10px;">
<!-- begin_blogs_list_image -->
<img src="{url_files}blog/{image}" border="0">
<!-- end_blogs_list_image -->
<div style="padding: 5px; ">{comment}
</div>
<!-- end_comment -->
<form action="{url_page}?id={id}" method="POST">
<input type="hidden" name="cmd" value="comment">
<textarea name="comment" style="width: 760px; height: 100px;" rows="1" cols="20"></textarea>
<input type="submit" class="button" style=" padding-left: 5px; padding-right: 5px;cursor: pointer; cursor: hand;" tabindex="13" value="{l_send_comment}">
{footer}
Ostatniego Pliku _header_blogi.html nie szło wgrać
Ten post edytował Darkon 17.08.2008, 20:47:24