4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: luener on August 16, 2009, 07:05:04 PM
-
Hallo...!
Ich habe auf der Seite www.hobby-fotografen.com gesehen dass man
mit einem Klick POSTEN u. BEWERTEN kann.
WIe bekomme ich das hin...???
Ich habe in der comment_form.html folgende Änderung (erfolglos) vorgenommen.
<td width="90" valign="top"> </td>
<td>
<input type="hidden" name="action" value="postcomment" />
<input type="hidden" name="id" value="{image_id}" /><INPUT type=radio value=5
name=rating> +5 Punkte<BR><INPUT type=radio value=4
name=rating> +4 Punkte <BR><INPUT type=radio value=3
name=rating> +3 Punkte <BR><INPUT type=radio value=2
name=rating> +2 Punkte<BR><INPUT type=radio value=1
name=rating> +1 Punkte <BR><INPUT type=radio CHECKED
value=0 name=rating> Keine Wertung
<INPUT class=button type=submit value="Kommentar posten" name=postbutton>
</td>
Der Kommentar wird wie immer gespeichert.
Das Voting klappt aber nicht. Zu sehen auf: http://topfoto24.to.funpic.de/details.php?image_id=80
Ich hoffe, jemand kann mir helfen.
Gruß
Ralf
-
Schon sehr interessant :!:
-
Habe die Radiobuttons wieder entfernt....!
Scheint, als wenn mir wohl neimand helfen kann.....SCHADE... :(...!
Gruß
Ralf
-
:flag-de: Kommentar posten u. Bewerten mit einem Klick...? Habe die Lösung gefunden...!
:flag-en: Comment and rate with one Click...? I found the Answer...!
:flag-de: Folgender Code ist von V@no: http://www.4homepages.de/forum/index.php?topic=4023.0
:flag-en: The following code is from V@no: http://www.4homepages.de/forum/index.php?topic=4023.0
Schritt 1. / Step 1.
:flag-de: Öffne details.php und finde:
:flag-en: Open details.php and find:
$sql = "INSERT INTO ".COMMENTS_TABLE."
:flag-de: Füge davor folgenden Code ein:
:flag-en: Insert above following Code:
//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if (intval($HTTP_POST_VARS['rating']) != "") {
$rating = intval($HTTP_POST_VARS['rating']);
$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
$cookie_rated = isset($HTTP_COOKIE_VARS[$cookie_name.'rated']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'])) : array();
if ($rating && $rating <= MAX_RATING && $id) {
if (!isset($session_info['rated_imgs'])) {
$session_info['rated_imgs'] = $site_sess->get_session_var("rated_imgs");
}
$split_list = array();
if (!empty($session_info['rated_imgs'])) {
$split_list = explode(" ", $session_info['rated_imgs']);
}
if (!in_array($id, $split_list) && !in_array($id, $cookie_rated)) {
$session_info['rated_imgs'] .= " ".$id;
$session_info['rated_imgs'] = trim($session_info['rated_imgs']);
$site_sess->set_session_var("rated_imgs", $session_info['rated_imgs']);
$cookie_rated[] = $id;
$cookie_expire = time() + 60 * 60 * 24 * 4;
setcookie($cookie_name.'rated', serialize($cookie_rated), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
update_image_rating($id, $rating);
$msg_color = 1;
$msg = $lang['voting_success'];
}
else {
$msg = $lang['already_voted'];
}
}
else {
$msg = $lang['voting_error'];
}
}
//////////////////////////////////////////
Schritt 2. / Step 2.
:flag-de: Das ist der Code meiner comment_form.html. Die Optik ist Deine Sache.
:flag-en: This is the Code of my comment_form.html. Visually it is your affair.
<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
<td valign="top" class="head1">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td valign="top" class="head1">{lang_post_comment}</td>
</tr>
<tr>
<td valign="top" class="row1">
<form name="commentform" action="{self}" method="post" onsubmit="postbutton.disabled=true;">
<input type="hidden" name="id" value="{image_id}" />
<input type="hidden" name="action" value="postcomment" />
<input type="hidden" name="action" value="rateimage" />
<table cellpadding="4" cellspacing="0" border="0">
<tr>
<td width="90" height="31"><b>{lang_name}</b></td>
<td height="31"><input type="text" name="user_name" size="30" value="{user_name}" class="commentinput" /></td>
</tr>
<tr>
<td width="140" valign="top"><b>{lang_comment}</b></td>
<td valign="top"> <table border="0" width="100%">
<tr>
<td width="301" valign="top"><textarea name="comment_text" id="content" cols="35" rows="10" maxlength="500" OnFocus="CountMax();" OnClick="CountMax();"
ONCHANGE="CountMax();" onKeydown="CountMax();" onKeyup="CountMax();" wrap="soft" class="commenttextarea" onFocus=myselection(this) onclick=myselection(this) onChange=myselection(this)>{comment_text}</textarea></td>
<td>
<table cellpadding="4" cellspacing="0" border="0" width="384">
<tr>
<td width="58%" valign="bottom">{if rate_form}<p> </p>
<p><input type="radio" name="rating" value="5">+5 Punkte
<br>
<input type="radio" name="rating" value="4">+4 Punkte <br>
<input type="radio" name="rating" value="3">+3 Punkte <br>
<input type="radio" name="rating" value="2">+2 Punkte <br>
<input type="radio" name="rating" value="1">+1 Punkte <br>
<input type="radio" name="rating" value="0" checked="">Keine Wertung {endif rate_form}<br>
<br>
<input type="submit" name="postbutton" value="Kommentar posten" class="button" /></td>
</tr>
</table>
</td>
</tr>
</table>
<p> {bbcode}</td>
</td>
</tr>
<tr>
<td width="90" valign="top" height="53"> </td>
<td height="53">
</td>
</tr>
<tr>
{if captcha_comments}
<tr>
<td width="90" valign="top"><b>{lang_captcha}</b></td>
<td>
<a href="javascript:new_captcha_image();"><img src="{url_captcha_image}" border="0" id="captcha_image" /></a>
<br />
<input type="text" name="captcha" size="30" value="" class="commentinput" id="captcha_input" />
<br />
{lang_captcha_desc}
<table border="0" cellspacing="0" cellpadding="3" class="row1">
<tr>
</tr>
</table>
</td>
</tr>
{endif captcha_comments}
<td width="90" valign="top"> </td>
<td>
<input type="hidden" name="action" value="postcomment" />
<input type="hidden" name="id" value="{image_id}" />
<p>
<input type="hidden" class="button" name="submit">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
:flag-de: Bei mir funzt es einwandfrei...!
:flag-en: It works on my Site
Gruß
Ralf
-
Hallo,
was müsste ich alles abändern, wenn ich ein Rating von 10 - 0 benötige?
Vielen Dank!
-
Hi!
...was müsste ich alles abändern, wenn ich ein Rating von 10 - 0 benötige?
...
in deinen Template/rate_form.html die Serie fortsetzen:
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
und in der includes/constants.php:
define('MAX_RATING', 5);
auf:
define('MAX_RATING', 10);
ändern.
mfg Andi