Author Topic: [MOD] Commentbox v0.2  (Read 27632 times)

0 Members and 1 Guest are viewing this topic.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
[MOD] Commentbox v0.2
« on: August 07, 2010, 02:22:36 PM »
Quote
[MOD] Commentbox v0.2 bietet eine Schnittstelle um das Kommentarformular in einem Popup öffnen zu lassen

Mit dieser Modifikation ist es möglich, dass man Kommentare über ein Popup schreiben kann. Das spart enormen Platz auf der Detailsseite und kommt den web2.0 Standard nahe. Die Voraussetzung ist Javascript und funktioniert mit der jQuery- Unterstützung.

Online Installation and Screenshots:  :arrow:
« Last Edit: November 19, 2010, 09:41:40 AM by Benny »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
First of all, thanks for the mod.

There are a few things that are not quiet right.
1) you've copied entire details.php into comment_pop.php - why? All it needs a part that saves the comment, it doesn't need anything else. And besides, provided comment_pop.php file doesn't work on fresh 4images, there are some parts left from your early modifications (it's always a good idea test it on unmodified 4images ;))
2) in comment_pop_form.html template you are using comment_pop.php in the form without parsing it through $site_sess->url() function, it can break sessions, and to make it maximum compatible with integrations, image_id must be replaced by constant URL_IMAGE_ID when parsing trough url() function. Also, there is some google code left from your site.
3) in details.html template you are adding new tag next to {rate_form}, which means if visitor not allowed to rate, they won't be able comment as well (link for comments will not be showed).
4) the link for pop will be showed even if visitor not allowed view comments, it's easily fixed by using {if comment_form}{comment_popup}{endif comment_form}
5) 4images is already suffers from having too much HTML code inside .php files, your javascript code is unnecessary placed inside details.php
6) since you are not providing any scirpts to update database with default values, you'll need to mention, that after installing this mod, one must go to ACP->Settings and manually enter width/height numbers for the popup dimensions.
7) would be nice if the popup close itself when comment successfully added.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
First of all, thanks for the mod.

There are a few things that are not quiet right.
1) you've copied entire details.php into comment_pop.php - why? All it needs a part that saves the comment, it doesn't need anything else. And besides, provided comment_pop.php file doesn't work on fresh 4images, there are some parts left from your early modifications (it's always a good idea test it on unmodified 4images ;)) If I take out everything else, then the form will not be displayed - Fixed
2) in comment_pop_form.html template you are using comment_pop.php in the form without parsing it through $site_sess->url() function, it can break sessions, and to make it maximum compatible with integrations, image_id must be replaced by constant URL_IMAGE_ID when parsing trough url() function. Also, there is some google code left from your site. Fixed
3) in details.html template you are adding new tag next to {rate_form}, which means if visitor not allowed to rate, they won't be able comment as well (link for comments will not be showed). Fixed
4) the link for pop will be showed even if visitor not allowed view comments, it's easily fixed by using {if comment_form}{comment_popup}{endif comment_form} Fixed
5) 4images is already suffers from having too much HTML code inside .php files, your javascript code is unnecessary placed inside details.php If the modification is off, then his need not to see the code or so?
6) since you are not providing any scirpts to update database with default values, you'll need to mention, that after installing this mod, one must go to ACP->Settings and manually enter width/height numbers for the popup dimensions. Fixed - Added install.php
7) would be nice if the popup close itself when comment successfully added. The popup closes after 2 seconds when the entry was successful - Fixed
« Last Edit: August 07, 2010, 06:52:57 PM by Sumale.nin »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
If I take out everything else, then the form will not be displayed
Ok, but there is no need code to display image, next/prev images, comments, etc. If you are planning on leaving everything as it is, then you could've simply add little code into details.php and comment_pop.php would not be necessary at all ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Saschilys

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Comment box in a popup window / Kommentarbox in einem Popup anzeigen
« Reply #4 on: September 27, 2010, 01:30:11 PM »
Ich habs mal installiert.
Wenn ich ein Kommentar abgeben möchte (oder auch andere das machen wollen)
kommt als Nachricht: Kommentarfunktion deaktivert...

Wo liegt der Fehler??

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Comment box in a popup window / Kommentarbox in einem Popup anzeigen
« Reply #5 on: September 27, 2010, 02:22:59 PM »
Der Fehler ist mir nicht bekannt.
Sind die Einstellungen auch richtig?
Bist du sicher das die Kommentarfunktion eingeschaltet ist?
Deaktiviere die Popup- Funktion und versuche so ein Kommentar zu schreiben

Offline Saschilys

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Comment box in a popup window / Kommentarbox in einem Popup anzeigen
« Reply #6 on: September 27, 2010, 05:58:24 PM »
Hab ich getan...

Kommentare funktionieren und sind aktiviert.
Wenn ich Popup einschalte, Kommentar schreiben möchte, erscheint diese o.g. Fehlermeldung.


Offline Saschilys

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
This message has been deleted by Rembrandt as spam!
« Last Edit: October 01, 2010, 06:36:26 PM by Rembrandt »

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Hi,

danke für den MOD Benny  :thumbup:

Ich glaube einen Fehler gefunden zu haben, du schreibst in deinem ersten Post folgende Codezeile:

Code: [Select]
 $comment_popup_jscode .= "   shoehe=shoehe+".$config['popup_comment_height'].";\n";
diese führt zumindest bei mir dazu das, dass Popup immer die doppelte höhe hat bzw. sich über die
gesamte Bildschirmhöhe erstreckt.

Meine Änderung:

Code: [Select]
 $comment_popup_jscode .= "   shoehe=".$config['popup_comment_height'].";\n";

EDIT:

Hi Benny,

bei mir führt:

Code: [Select]
{if allow_comments}{comment_popup}  {endif allow_comments}
dazu das auch Gäste den Link sehen und wenn er angeklickt wird fehlt im
Popup die comment form es ist nur der footer zu sehen.

Hat jemand eine Idee?


EDIT2:

Hi Benny,

ich hab noch ein viel gravierenderes Problem:

Die Kommentare landen nicht beim gewollten Bild sondern scheinbar Wahllos woanders,
hier Beispiele:

Code: [Select]
comment_popup.php?image_id=5006 = 4984

comment_popup.php?image_id=3350 = 4820

Kommentare landen je bei der ID hinter dem gleich. Mir ist das eben aufgefallen als ich
einen Testkommentar geschrieben habe.

Hilfe bitte...


Gruß Jens


Gruß X23
« Last Edit: November 04, 2010, 01:57:58 PM by x23piracy »

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Comment box in a popup window / Kommentarbox in einem Popup anzeigen
« Reply #9 on: November 04, 2010, 05:10:39 PM »
Ich  muss das in einer frischen Installation mal testen, nur Momentan keine Zeit! Aber am WE eventuell

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [MOD] Comment box in a popup window / Kommentarbox in einem Popup anzeigen
« Reply #10 on: November 04, 2010, 05:20:22 PM »
Ich  muss das in einer frischen Installation mal testen, nur Momentan keine Zeit! Aber am WE eventuell

Hi,

wäre prima :) bis dahin habe ich es erstmal ausgeschaltet.
Danach ging/geht wieder alles wie gewohnt.


Gruß Jens

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Commentbox v0.2
« Reply #11 on: November 14, 2010, 12:55:26 PM »
Neue Version online!
Online Installation:  :arrow:

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [MOD] Commentbox v0.2
« Reply #12 on: November 14, 2010, 05:38:08 PM »
Neue Version online!
Online Installation:  :arrow:

Hi Benny,

ich habs ausprobiert sehe den Link zur Popup Box aber nicht.

Ich habe hier noch zwei Fehler gefunden:

Code: [Select]
$setting['comment_popup_height'] = "Popup Höhe<br><span class="\"smalltext\"">In Pixel angeben. Empfohlen: 100</span>";
$setting['comment_popup_width'] = "Popup Breite<br><span class="\"smalltext\"">In Pixel angeben. Empfohlen: 480</span>";

So funktioniert es bei mir:

Code: [Select]
$setting['comment_popup_height'] = "Popup Höhe<br><span class=\"smalltext\">In Pixel angeben. Empfohlen: 100</span>";
$setting['comment_popup_width'] = "Popup Breite<br><span class=\"smalltext\">In Pixel angeben. Empfohlen: 480</span>";

Desweiteren verlierst du kein Wort in deiner Readme zur "comment_popup_form.html"
Wo die hin muss weiß ich aber irgendwer vielleicht nicht ;)

Hmm hast du ne Idee wieso das bei mir nicht auftaucht?

Dein Script...:

Code: [Select]
if($config['comment_popup_onoff'] == 1)  {
   $comment_form = " <script src=\"".ROOT_PATH."comment_popup/jquery.js\" type=\"text/javascript\"></script>\n";
   $comment_form .= " <script src=\"".ROOT_PATH."comment_popup/popup.js\" type=\"text/javascript\"></script>\n";
   $comment_form .= " <script type=\"text/javascript\">\n";
   $comment_form .= "     jQuery(document).ready(function($) {\n";
   $comment_form .= "       $('a[rel*=facebox]').facebox({\n";
   $comment_form .= "         loading_image : '".ROOT_PATH."comment_popup/loading.gif',\n";
   $comment_form .= "         close_image   : '".ROOT_PATH."comment_popup/closelabel.gif'\n";
   $comment_form .= "       }) \n";
   $comment_form .= "     })\n";
   $comment_form .= " </script>";
   $comment_form .= " <a href=\"#info\" rel=\"facebox\">".$lang['post_comment']."</a>\n";
   $comment_form .= " ".$site_template->parse_template("comment_popup_form")."\n";
   }

...sollte doch unabhängig sein vom dem was in der details.html steht? Ich kann mir nicht erklären
wo der Link sein soll bzw. warum er fehlt.

Der Code Part wird scheinbar durchlaufen, da bei fehlen der comment_popup_form.html das System
nach dem fehlenden Template mault und es wird ja nur hier referenziert:

Code: [Select]
$comment_form .= " ".$site_template->parse_template("comment_popup_form")."\n";
Hmm ohje ich komm hier alleine nicht weiter... Hilfe Benny  :D


Gruß Jens
« Last Edit: November 14, 2010, 05:49:33 PM by x23piracy »

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Commentbox v0.2
« Reply #13 on: November 14, 2010, 05:45:12 PM »
Danke,
den Fehler habe ich in der Anleitung ausgetestet!

Zu dem Link,
hast du in deiner lang/deutsch/main.php folgenden Code stehen?
$lang['post_comment']

Der Link wird in der details.php generiert
$comment_form .= " <a href=\"#info\" rel=\"facebox\">".$lang['post_comment']."</a>\n";

Das ist für den Link zuständig!

Hast du ein Link zur Seite?

Edit://
Die comment_pop_form.html muss in deinem templates ordner. Wenn die dort nicht vorhanden ist, ist ja klar das er meckert!

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [MOD] Commentbox v0.2
« Reply #14 on: November 14, 2010, 05:53:42 PM »
Zu dem Link,
hast du in deiner lang/deutsch/main.php folgenden Code stehen?
$lang['post_comment']

Ist vorhanden...

Der Link wird in der details.php generiert
$comment_form .= " <a href=\"#info\" rel=\"facebox\">".$lang['post_comment']."</a>\n";

Das hab ich ja schon gesehen der ist aber im Quelltext nicht (Erzeugte Seite)...

Hast du ein Link zur Seite?

Die comment_pop_form.html muss in deinem templates ordner. Wenn die dort nicht vorhanden ist, ist ja klar das er meckert!

Das ist mir klar ich wollte dir nur mitteilen das eine Erwähnung in deiner Readme dazu fehlt ;)

Hier mal noch der ausgedünnte Code meiner details.html falls das für die Funktion des
Popups relevant ist zur Kontrolle für dich:

Code: [Select]
{header}

<div class="header"></div>

<table width="100%"  border="0" cellspacing="0" cellpadding="0">

<td width="100%" valign="top">

<table align="center" border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td>{if prev_image_name}<a href="{prev_image_url}" title="{prev_image_name}"><img border="0" src="{template_url}/images/prev.png"></a>{endif prev_image_name}</td>
<td><div align="center" id="imagebg"><br>{ms_style}<br></div></td>
<td>{if next_image_name}<a href="{next_image_url}" title="{next_image_name}"><img border="0" src="{template_url}/images/next.png"></a>{endif next_image_name}</td>
</tr>
</table>

<br>

    <table align="center" cellspacing='1' cellpadding="0" border='0'>
        <tr>
            <td width='12' height='12' bgcolor='#000' style="border: 1px solid #828282;" onmouseover=bg('#000')></td>
            <td width='12' height='12' bgcolor='#171717' style="border: 1px solid #828282;" onmouseover=bg('#171717')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#2E2E2E' style="border: 1px solid #828282;" onmouseover=bg('#2E2E2E')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#464646' style="border: 1px solid #828282;" onmouseover=bg('#464646')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#5D5D5D' style="border: 1px solid #828282;" onmouseover=bg('#5D5D5D')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#747474' style="border: 1px solid #828282;" onmouseover=bg('#747474')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#8B8B8B' style="border: 1px solid #828282;" onmouseover=bg('#8B8B8B')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#A2A2A2' style="border: 1px solid #828282;" onmouseover=bg('#A2A2A2')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#B9B9B9' style="border: 1px solid #828282;" onmouseover=bg('#B9B9B9')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#D1D1D1' style="border: 1px solid #828282;" onmouseover=bg('#D1D1D1')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#E8E8E8' style="border: 1px solid #828282;" onmouseover=bg('#E8E8E8')>&nbsp;</td>
            <td width='12' height='12' bgcolor='#FFFFFF' style="border: 1px solid #828282;" onmouseover=bg('#FFFFFF')>&nbsp;</td>
        </tr>
    </table>

<br>

<div align="center">{if details}{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;{if has_rss}<a href="{rss_url}"><img src="{template_url}/images/rss.png" title="{rss_title}" border="0" alt="{rss_title}" />&nbsp;&nbsp;</a>{endif has_rss}{download_button}&nbsp;&nbsp;{download_zip_button}{endif details}</div>

<map name="navi">
{if prev_image_name}
  <area shape="rect" coords="0,0,150,{height}"
   href="{prev_image_url}" alt="{prev_image_name}">
{endif prev_image_name}
{if next_image_name}
  <area shape="rect"  coords="{navi},0,{width},{height}"
   href="{next_image_url}" alt="{next_image_name}">
   {endif next_image_name}
</map>

{if msg}
{msg}
{endif msg}

</td>
 </tr>
</table>

es handelt sich nicht um meine icon Seite, ich schick dir den Link gleich per PM,
sind privat Fotos drin ;)


Gruß Jens

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--