4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Vincent on August 16, 2005, 05:37:34 PM
-
Hello
i look for the code which say total comment: 18
i would like to add this information to the side navigationbar!
thanks for feedback
vincent
-
You mean this one :
{image_comments}
?
-
{image_comments}
added this {image_comments} what is the result?
i would like to have as result in my case now 18 because i have 18comments!
vincent
-
You'd like to add this starting from the index page right ?
-
yes from the index page but also categorie detail page and so one - it stay on the left side in the navig list
-
http://www.4homepages.de/forum/index.php?topic=9283.0
the link which V@no gave the code for the lightbox counter in the navig
works only if registerd this MOD
this now requested mod should also work for all guest
-
If the comments has not been populated like the lightbox yet (as I said: If), then - in that case - additional codings from includes/functions.php file would need to be done since, for the lightbox, it uses the lightbox_image_ids on many lightbox actions.
-
hallo vincent,
... also ein Kommentar-Counter in der home.html (bzw. auf allen Hauptseiten) ...
... dann hätte ich dieses für dich ... getestet und funktionstüchtig ... :wink:
folgendes in die includes/page_header.php vor :
?>
einsetzen :
//-----------------------------------------------------
//--- Kommentar-Counter ---
//-----------------------------------------------------
$sql = "SELECT SUM(image_comments) AS sum
FROM ".IMAGES_TABLE;
$row = $site_db->query_firstrow($sql);
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
$total_comments = $row['sum'];
$site_template->register_vars("total_comments", $total_comments);
unset($total_comments);
nun kannst du in der home.html (deiner Navigationsbar) bzw. allen html-Hauptseiten folgendes als Counter verwenden :
Anzahl der Kommentare : {total_comments}
das sollte es gewesen sein ... ist aber zunächst nur einsprachig ... und ich denke du brauchst es nur in deutsch ... :wink:
(es werden nun noch Vorschläge mit ... $lang_total_comments ... von :?: kommen ... :mrgreen: )
mawenzi
-
I already tried coding that one ... does it actually work ?
-
hi TheOracle
it works absolutely perfect ... :wink:
mawenzi
-
I found my mistake.
I stated :
$sum = (isset($row['sum'])) ? $row['sum'] : "";
rather than :
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
Thanks for posting this. ;)
-
i am to stupied - how to add the {total_comments} code into a php file?
<tr>
<td width="100%" align="center" height="20" background="templates/4dark/bbutton.gif">
<div align="left">
<a style="text-decoration: none" href="soldpubl.php">> Verkaufte Fotos {total_comments}</a>
</div>
</td>
</TR>
Vincent
-
May I ask why this should be added into PHP files rather than HTML files ?
-
because the hole navig list is a php file! :wink:
i am not the coder just a user - so don't ask me - until know it is just fine working like this
vincent
-
Hum ... to be safe, let's rather do it like this :
//-----------------------------------------------------
//--- Kommentar-Counter ---
//-----------------------------------------------------
$sql = "SELECT SUM(image_comments) AS sum
FROM ".IMAGES_TABLE;
$row = $site_db->query_firstrow($sql);
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
$total_comments = $row['sum'];
$site_template->register_vars("total_comments", $total_comments);
$site_template->parse_template("total_comments_page");
unset($total_comments);
Then, create a file called : total_comments_page.html in your templates/<your_template> folder and paste your posted HTML content in that file.
Should work from there. ;)
-
hallo Vincent,
deine Navigationsliste ist eine html-Datei ... aber mit php-Extension ... :? ... sicher um sie "includen" zu können ...
dann versuche den Kommentrar-Counter in der Navigationsliste mal so zu integrieren ...
...
<a style="text-decoration: none" href="soldpubl.php">> Verkaufte Fotos <? print $total_comments ?></a>
...
mawenzi
-
<a style="text-decoration: none" href="soldpubl.php">> Verkaufte Fotos <? print $total_comments ?></a>
This method would not be advisable since your URL is not being used under sessions.
Althought, what you could do is this (if you intend to use it under PHP) :
<a style=\"yourCSSfile(rather than the code directly here)\" href=\"".$site_sess->url(ROOT_PATH."soldpubl.php")."\">> Verkaufte Fotos ".$total_comments."</a>
;)
-
@ TheOracle,
... mmm ... your solution don't work in html-files renamed as php-files ... like in templates by vierstra ... :?
@ Vincent,
folgendes habe ich für deine verzwickte Situation (Template by vierstra.com) getestet ...
1. den Kommentar-Counter hast du wie bereits beschrieben in der page_header.php eingebaut
2. in allen Template-Seiten in denen du diesen Counter in deiner Navigationsleiste zeigen willst , also home.html, usw. ... , fügst du unmittelbar unter {header} folgendes ein :
<?php
$tc = "{total_comments}";
?>
3. nun kannst du in deiner menue.php (bzw. wie deine Navigationsliste heist) folgendes für die Anzahl der Kommentare (bei dir, die der verkauften Bilder) verwenden ( <? print $tc ?> ). Dein Link im Menü würde dann so aussehen :
<a style="text-decoration: none" href="soldpubl.php">> Verkaufte Fotos <? print $tc ?></a>
soweit funktioniert es zunächst nach dem Prinzip von vierstra !
4. Die Verwendung deiner Links in der Navigationliste unter "sessionsid" (wie von TheOracle angeregt) solltest du dann anschließend noch prüfen ! Wobei ich den Link mit sess-id in der page_header.php registrieren würde.
"url_soldpubl" => $site_sess->url(ROOT_PATH."soldpubl.php"),
so dass du als URL für den Link in der menue.php (bzw. wie deine Navigationsliste heist) folgendes verwenden kannst : {soldpubl}
mawenzi
-
@Mawenzi
VIELEN DANK für die Hilfe - es geht - hab es aber doch ein bisschen anders gemacht!
statt es (<?php $tc = "{total_comments}"; ?>) in jeder HTML Datei unter {header} einzufügen habe ich es in der header.html datei am schluss eingefügt!
Danach musste ich nur noch <? print $tc ?> nach dem verkaufte Fotos text eingeben! und es funzt so wie ich es mir wünschte !
nochmals vielen Dank! :wink:
vincent
-
... habe ich es in der header.html datei am schluss eingefügt!
... hast natürlich Recht ... hatte es nur auf einer Seite getestet und von daher mein voreiliger Schluss ... :lol:
freut mich, dass es nun endlich geklappt hat ...
mawenzi
-
@ TheOracle,
... mmm ... your solution don't work in html-files renamed as php-files ... like in templates by vierstra ... Confused
My solution was never about renaming HTML files as PHP files but parsing PHP initials into HTML files. :?