Author Topic: Kommentar posten u. Bewerten mit einem Klick ???  (Read 16351 times)

0 Members and 1 Guest are viewing this topic.

Offline luener

  • Jr. Member
  • **
  • Posts: 54
  • Pessimisten sind Optimisten mit mehr Erfahrung!
    • View Profile
    • TopFoto24.com
Kommentar posten u. Bewerten mit einem Klick ???
« 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.

Code: [Select]
<td width="90" valign="top">&nbsp;</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
« Last Edit: August 16, 2009, 07:23:29 PM by luener »

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: Kommentar posten u. Bewerten mit einem Klick ???
« Reply #1 on: August 16, 2009, 07:13:00 PM »
Schon sehr interessant  :!:

Offline luener

  • Jr. Member
  • **
  • Posts: 54
  • Pessimisten sind Optimisten mit mehr Erfahrung!
    • View Profile
    • TopFoto24.com
Re: Kommentar posten u. Bewerten mit einem Klick ???
« Reply #2 on: August 29, 2009, 11:11:53 AM »
Habe die Radiobuttons wieder entfernt....!
Scheint, als wenn mir wohl neimand helfen kann.....SCHADE... :(...!

Gruß
Ralf

Offline luener

  • Jr. Member
  • **
  • Posts: 54
  • Pessimisten sind Optimisten mit mehr Erfahrung!
    • View Profile
    • TopFoto24.com
Re: Kommentar posten u. Bewerten mit einem Klick ???
« Reply #3 on: November 03, 2009, 10:34:52 AM »
: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_expireCOOKIE_PATHCOOKIE_DOMAINCOOKIE_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.


Code: [Select]
<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">&nbsp;<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>&nbsp;</p>
<p><input type="radio" name="rating" value="5">+5 Punkte&nbsp;
<br>
<input type="radio" name="rating" value="4">+4 Punkte&nbsp;&nbsp; <br>

<input type="radio" name="rating" value="3">+3 Punkte&nbsp;&nbsp; <br>
<input type="radio" name="rating" value="2">+2 Punkte&nbsp;&nbsp;&nbsp; <br>
<input type="radio" name="rating" value="1">+1 Punkte&nbsp;&nbsp; <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>&nbsp;{bbcode}</td>
 
 
 
   
  </td>
 
 
 
                </tr>
                <tr>
                  <td width="90" valign="top" height="53">&nbsp;</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" />&nbsp;&nbsp;

                    <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">&nbsp;</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">
              &nbsp;</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
           

Offline crs

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: Kommentar posten u. Bewerten mit einem Klick ???
« Reply #4 on: January 16, 2012, 11:57:39 PM »
Hallo,

was müsste ich alles abändern, wenn ich ein Rating von 10 - 0 benötige?

Vielen Dank!

Rembrandt

  • Guest
Re: Kommentar posten u. Bewerten mit einem Klick ???
« Reply #5 on: January 17, 2012, 04:51:33 AM »
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:
Code: [Select]
<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