Jump to content

dotnetic

Members
  • Posts

    1,078
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by dotnetic

  1. No response after four days. So I have to do it myself. Right now I got two custom inputfields working (title and rating), but yet without the stars. Thats the next step. I will post the result in the forums.
  2. Yes it is my first time working on a module. I added two fields (title and rating). I will take a look at the FieldtypeEvent module for learning purposes.
  3. Sure. Thanks for helping me The module is here Extract it to site/modules and then install both modules in PW. Here is the code I use to render the comments and the form on the frontend: <div class="row"> <?php $commentnumber = 0; foreach ($page->commentsrating as $comment) { if ($comment->status < 1) continue; // skip unapproved or spam comments // if ($comment->status < 1 || $commentnumber >= 3) continue; // skip unapproved or spam comments $commentnumber++; $cite = htmlentities($comment->cite); // make sure output is entity encoded $text = htmlentities($comment->text); $title = htmlentities($comment->title); $rating = htmlentities($comment->rating); $date = date('d/m/Y g:ia', $comment->created); // format the date echo " <div class=\"review\" itemscope itemtype=\"http://schema.org/Review\">"; echo "\n\t<div class='rating' itemprop='reviewRating' itemscope itemtype='http://schema.org/Rating'>"; echo " <span itemprop='ratingValue'>$rating</span><span class='fa fa-star star selected'></span><span class='fa fa-star star selected'></span><span class='fa fa-star star selected'></span><span class='fa fa-star star selected'></span>"; echo "\n\t\t<span itemprop='author' itemscope itemtype='http://schema.org/Person'><span itemprop='name'>$comment->cite</span>"; echo "\n\t</span>"; echo "</div>"; echo "<span itemprop='reviewBody'>"; echo "<strong class='title'>$title</strong>"; echo "<em>$comment->text</em>"; echo "</span>"; echo "</div>"; } ?> </div> <div class="text-centered"> <button class="btn" id="showcomments"><i class="fa fa-comment"></i> Kommentieren</button> </div> <?php echo $page->commentsrating->renderForm(array( 'headline' => "<h3>Sag uns deine Meinung</h3>", 'successMessage' => "<p class='success'>Danke. Dein Kommentar erscheint, sobald wir ihn freigegeben haben.</p>", 'pendingMessage' => "<p class='success'>Danke. Dein Kommentar erscheint, sobald wir ihn freigegeben haben.</p>", 'errorMessage' => "<p class='error'>Dein Kommentar konnte nicht gespeichert werden. Bitte überprüfe, ob du alle Felder korrekt ausgefüllt hast, bevor du es erneut probierst.</p>", 'processInput' => true, 'encoding' => 'UTF-8', 'attrs' => array( 'id' => 'CommentForm', 'action' => './', 'method' => 'post', 'class' => '', 'rows' => 5, 'cols' => 50, ), 'labels' => array( 'cite' => 'Dein Name', 'title' => 'Titel', 'email' => 'Deine E-Mail', 'text' => 'Deine Meinung', 'submit' => 'Abschicken', ), // the name of a field that must be set (and have any non-blank value), typically set in Javascript to keep out spammers // to use it, YOU must set this with a <input hidden> field from your own javascript, somewhere in the form 'requireSecurityField' => '', // not used by default )); ?>
  4. Thanks for clearing up. There was one line left in FieldtypeCommentsRating.module, which I changed now: $inputfield = $this->modules->get('InputfieldCommentsRatingAdmin'); Now on to the next problem. Because my custom fields don´t get saved.
  5. @LostKobraKai: Could you explain it different? I copied the whole FieldtypeComments folder. The InputfieldCommentsAdmin.module is within that folder. I renamed that file to InputfieldCommentsRatingAdmin.module and changed all instances of "Comment" to "CommentRating" like in this excerpt: class InputfieldCommentsRatingAdmin extends Inputfield implements InputfieldItemList { public static function getModuleInfo() { return array( 'title' => __('Comments Admin', __FILE__), 'version' => 104, 'summary' => __('Provides an administrative interface for working with comments', __FILE__), 'permanent' => false, 'requires' => 'FieldtypeCommentsRating', ); } protected $commentIDsToNumbers = array(); public function init() { parent::init(); } protected function ___renderItem(CommentRating $comment, $n) { $statuses = array( CommentRating::statusApproved => $this->_x('Approved', 'comment-status'), CommentRating::statusPending => $this->_x('Pending', 'comment-status'), CommentRating::statusSpam => $this->_x('Spam', 'comment-status'), ); After that I installed the module "InputfieldCommentsRatingAdmin" in PW Modules section but the error still occurs.
  6. @ryan I made a copy of the FieldtypeComments module and did as you described. Then I refactored and renamed the class of Comment to CommentRating. I installed the new module in PW. Changed my existing comments field to use CommentRating instead of Comments. That worked fine. But now when I open the page in PW Backend with the template which has the CommentRating field in it I see an error: ( ! ) Catchable fatal error: Argument 1 passed to InputfieldCommentsAdmin::___renderItem() must be an instance of Comment, instance of CommentRating given in W:\wamp\www\beeline\gehaltsprofis\www\wire\modules\Fieldtype\FieldtypeComments\InputfieldCommentsAdmin.module on line 34 Why is FieldtypeComments still used? How can I fix this? Please help. I can provide you with the files if you need them. EDIT: If I remove FieldtypeComments from wire/modules/Fieldtype it seems to work fine
  7. @ryan There is a problem on mobiles after submitting the form because the page is being redirected to #CommentsForm, but the #CommentPostNote is outside of the #CommentsForm, so users on mobile don´t see it. Would be better if the success message is included in the form.
  8. @ryan It seems that successMessage in a custom render call has no effect. EDIT: There is a pendingMessage string, that is being used. So what is the difference between pendingMessage and successMessage? EDIT2: Understood it now. When the approval is not needed, successMessage is being used. I used echo $page->comments->renderForm(array( 'headline' => "<h3>Sag uns deine Meinung</h3>", 'successMessage' => "<p class='success'>Danke. Dein Kommentar erscheint, wenn wir ihn freigegeben haben.</p>", 'errorMessage' => "<p class='error'>Dein Kommentar konnte nicht gespeichert werden. Bitte überprüfe, ob du alle Felder korrekt ausgefüllt hast, bevor du es erneut probierst.</p>", 'processInput' => true, 'encoding' => 'UTF-8', 'attrs' => array( 'id' => 'CommentForm', 'action' => './', 'method' => 'post', 'class' => '', 'rows' => 5, 'cols' => 50, ), 'labels' => array( 'cite' => 'Dein Name', 'email' => 'Deine E-Mail', 'text' => 'Deine Meinung', 'submit' => 'Abschicken', ), // the name of a field that must be set (and have any non-blank value), typically set in Javascript to keep out spammers // to use it, YOU must set this with a <input hidden> field from your own javascript, somewhere in the form 'requireSecurityField' => '', // not used by default )); But after successful submitting the form, the message "Your comment has been submitted and will appear once approved by the moderator" appears still in english. errorMessage works fine.
  9. Offering a #job for a #processwire #developer. It´s urgent. Details here https://t.co/g0OmHmYHah

  10. I am looking for a developer who can extend the comments fieldtype for me. I need two additional fields: add a field "title" add a star rating field (in backend and frontend) the rating field in the backend can be an input field and does not have to display as stars, but would be nice. The frontend needs to display the rating as stars. There are two Star Rating modules already available, one is a rating for pages https://processwire.com/talk/topic/7871-page-ratings/ the other https://processwire.com/talk/topic/10107-fieldtypestarrating/ is a fieldtype. I need a solution that has the ability to be rendered as average ratings (so half stars are possible, you can find the code in the first module I mentioned, the second one just handles integers). There are two types of output. One is for amazon.de products and will show average ratings (see attached screenshot) and the other one is for a comment and only shows full stars. Pls provide me an offer/estimate. After we agreed, I provide you with FTP and Backend access and you tell me which files changed. Work needs to be done until 21. August 2015.
  11. I just love the easy and intuitive #processwire API. @processwire rocks!

  12. I am also looking for this as a fieldtype, because I have a Repeater field for different products with ratings. Also I want to integrate this with the comments fieldtype. How would I do that? I found https://processwire.com/talk/topic/10107-fieldtypestarrating/ as an alternative, which is a fieldtype, but it doesn´t handle floats (average ratings) and has no option to use the star rating on the frontend (rating and saving to database).
  13. How can I integrate this into PHPStorm? I am using version 9 right now. I want the autocompletition so bad. Pls help.
  14. Verlag Peter Jentschura - Neuer #Shop online! #Konzept, #Design und Umsetzung durch mich.

  15. I had the same problems with fresh install of ProcessWire 2.5.3 on a local webserver (Win 8.1 WAMPSERVER). After clearing the browser history no more logouts.
  16. RT @sindresorhus: .@addyosmani Moments of a programmer's life. http://t.co/jye0aSe5xz

  17. Can anyone support me with #prestashop and Land of Coder Download module? I want to link to a subcategory from main menu.

  18. This is really nice. Is this module multilanguage? How do we add translations? I would help with german translations.
  19. Now i tried if (count($page->images)) { $str= "<img src='{$page->images->first->url}' class='img-responsive' alt='' />"; $modules->TextformatterSrcset->formatValue(new Page(), new Field(), $str); echo $str; } as suggested by soma, but i get a 500 Internal Server Error. Can you see whats wrong?
  20. Yeah, thats exactly what i meant @horst, @Philipp. Hope someone comes up with an easy solution.
  21. How can i use this for image fields instead of body or another content field? So if i added one or multiple images i want to use a simple code to output the image tag with srcset attributes: <?php echo $page->images->first->srcset; ?> Is that possible or is there an alternative? I know that i can write the code by myself by using the following code, but it could be nicer if the module does the output for me.
  22. Check out http://t.co/IUziPPQkw4 web+mobile Axure widget libraries. Free twitter bootstrap widgets #ux #mockups http://t.co/tfxNY171Z2

  23. Hat irgendjemand nen Google Inbox Invite für mich übrig? Meine E-Mail schick ich dann per Direktnachricht.

  24. I've started using @PasswordBox to store all my passwords. It's pretty great. You should check it out: http://t.co/3nnKkymZiB

×
×
  • Create New...