zikula-modules / ezcomments Goto Github PK
View Code? Open in Web Editor NEWAdd comments to almost anything
Add comments to almost anything
There is still an important update missing. Someone should release a new version soon, because the previous is buggy.
I am using EZComments for 1.4.0 and News-master
Notice: Undefined index: anonusersrequirename in /www/htdocs/w0137ee9/omi.11cv.net/Zikula_Core-1.4.0/app/cache/prod/ztemp/view_compiled/EZComments/Standard/ezcomments_user_view--t_Zikula/Theme/Andreas08Theme-l_de.php on line 136
In some cases comment is written, but in ezcomments table modname column is empty.
This results comment not to show enywhere.
Mainly this happens with some caching enabled.
I added a function to EZComments so that a user can also add an image to a comment.
diff -r org/lib/EZComments/Api/User.php mod/lib/EZComments/Api/User.php
221a222,223
>
> $args['image'] = isset($args['image']) ? trim($args['image']) : '';
284a287
> 'image' => $args['image'],
diff -r org/lib/EZComments/Controller/User.php mod/lib/EZComments/Controller/User.php
228a229
> $image = isset($args['image']) ? $args['image'] : $this->request->files->get('image');
290a292,325
>
> $fileName = '';
>
> if($image['name'] != ''){
> $fileNameParts = explode('.', $image['name']);
> $extension = $fileNameParts[count($fileNameParts) - 1];
> $extension = str_replace('jpeg', 'jpg', strtolower($extension));
>
> if($extension != "jpg")
> {
> SessionUtil::setVar('ezcomment', serialize($ezcomment));
> return LogUtil::registerError($this->__('Error! Only .jpg images are allowed!'), null,
> $redirect."#commentform_{$mod}_{$objectid}");
> }
>
> $basePath = FileUtil::getDataDirectory() . '/EZComments/image/';
>
>
>
> do {
> $fileName = md5(uniqid(mt_rand(), TRUE)) . '.' . $extension;
> }
> while (file_exists($basePath . $fileName)); // repeat until we have a new name
>
> $upload = FileUtil::uploadFile('image', $basePath, $fileName);
>
>
> if($upload !== true){
> SessionUtil::setVar('ezcomment', serialize($ezcomment));
> return LogUtil::registerError($this->__('Error during upload!') . ' ' . $upload, null,
> $redirect."#commentform_{$mod}_{$objectid}");
> }
>
> }
309c344,345
< 'anonwebsite' => $anonwebsite));
---
> 'anonwebsite' => $anonwebsite,
> 'image' => $fileName));
diff -r org/lib/EZComments/Installer.php mod/lib/EZComments/Installer.php
66a67,70
> // Image upload
> if(mkdir(FileUtil::getDataDirectory() . '/EZComments/image/') == false){
> LogUtil::registerError($this->__('Error! Could not create upload directory. (' . FileUtil::getDataDirectory() . '/EZComments/image/)'));
> }
135a140,144
> // Image upload
>
> if(mkdir(FileUtil::getDataDirectory() . '/EZComments/image/') == false){
> LogUtil::registerError($this->__('Error! Could not create upload directory. (' . FileUtil::getDataDirectory() . '/EZComments/image/)'));
> }
diff -r org/tables.php mod/tables.php
42c42,43
< 'anonwebsite' => 'anonwebsite'
---
> 'anonwebsite' => 'anonwebsite',
> 'image' => 'image'
61c62,63
< 'anonwebsite' => "C(255) NOTNULL DEFAULT ''"
---
> 'anonwebsite' => "C(255) NOTNULL DEFAULT ''",
> 'image' => "C(255) NOTNULL DEFAULT ''"
diff -r org/templates/Standard/ezcomments_user_view.tpl mod/templates/Standard/ezcomments_user_view.tpl
54a55,57
> <div class="ezc_image">
> {$comment.image|showImage}
> </div>
105a109,113
> </div>
>
> <div class="z-formrow">
> <label for="image">{gt text='Image' domain='module_ezcomments'}</label>
> <input name="image" type="file" />
<?php
/**
* EZComments
*
* @copyright (C) EZComments Development Team
* @link https://github.com/zikula-modules/EZComments
* @license See license.txt
*/
/**
* Smarty modifier to show a comment-image
*
* Example
*
* {$MyVar|showImage}
*
*
* @author Gabriel Freinbichler
* @since 23.07.2012
* @param array $string the name of the image
* @return string html-img tag
*/
function smarty_modifier_showImage($name)
{
if($name != '')
{
return '<img src="' . FileUtil::getDataDirectory() . '/EZComments/image/' . $name . '" />';
}
return '';
}
Make the mail configurable for each single moderator.
I think that EZComments should not store the current URL with each comment.
We should store:
module
type
func
parameter
Because:
If we use DirectoryBased? ShortURLs and we change the title of e.g. news or publication, the EZComments-URL to this comment (block) isn't correct anymore.
I like the way crpTag does it: call *_userapi_getmodulemeta to get the information
Last tag v3.0.0 was made in August 2011, and last commit made in July 2014 has 3.0.1 version.
I suggest tag 3.0.1 to track the module in other projects.
Thanks,
Joan
see the topic please
Only a little detail.
In the file composer.json, the line with version "version": "4.0",
It's not correct.
Zikula follow Semantic Versioning, so, the correct version is "4.0.0".
In follow version, you must change this 👍
Thanks.
I'm using Zikula 1.2.4 + EZComments 2.0.0 + Blank Theme and the pager in user view doesn't work. The results are the same with directory-based short URLs, deactivating the short URLs and with different themes.
comment:1 Changed 6 months ago by myths
Confirm this issue, the same problem, paginate does not work at all in short URLs (directory-based)
Hello,
I've upgraded EZComments to version 2.0.0, everything was working before as expected.
Now the settings for Blacklisting & Notification are ignored.
I checked the boxes for "Send mail on new comment" and "Send mail on comment requiring moderation" and words like "ringtones" are in my blacklist. Also comments with more than 5 links should be blacklisted.
But these settings seem to get ignored, as you can see in the comments of my website. http://series60-remote.sourceforge.net/index.php?module=Content&func=view&pid=8
I also don't receive a mail if anybody writes a new comment.
comment:1 Changed 13 months ago by LuHe
I changed pnuserapi.php, line 243 from
$status[] = _EZComments_userapi_checkcomment($$checkvar);
to
$status[] = _EZComments_userapi_checkcomment($args[$checkvar]);
and it seems to work now.
comment:2 Changed 13 months ago by LuHe
The mail to the administrator doesn't work, because
$argsuid? is 0 and $owneruid is also 0, so the if statement is false.
Solved this by removing !in_array($argsuid?, array(2, $owneruid) from the two if blocks,
Hello.
When you add a comment and you dont fill the subject field, an error message appear: There was a problem with your comment?. Please enter a subject for your comment
This field was not mandatory in the past. IMO this field should be optional, because this is not a mail or message that someone can receive without knowing the reason.
You are already writing about an item, the subject is the item itself (I hope the reason is understood).
Also, when you reply a comment with a subject, i was waiting that the subject was auto-filled with RE: (text from first subject)
, but when you reply, the field subject is empty, so that you have that write a new subject.
Thanks.
The rating of comments should be possible. The User can rate positiv or negativ. The Result will be shown in a bar (red/green). Also the Count of rating should be shown.
See the screenshot for a better understanding.
Maybe there can also be a mechanism where after 10 negativ (Sum of pos and neg) Ratings the Posting will be deleted.
uiView in HookHandlers does not consider the area-id
$items = ModUtil::apiFunc('EZComments', 'user', 'getall',
compact('mod', 'objectid', 'sortorder', 'status', 'numitems', 'startnum'));
Durung upgrade from Reviews module 1.0 to version 2.3 or 2.4 the old style reviews comments in Reviews 1.0 will be migrated to EZComments. This fails because EZComments_migrateapi_reviews() declares the function Reviews_pntables() a second time in EZComments/pnmigrateapi/Reviews/pntables.php. This is not neccessary because the old style table structure will be added correctly in EZComments_get76xcolumns_reviews.
Above this I extended the migrate function to preserve the content owner IDs and use the actual parameter names for EZComments_userapi_create().
Here are the modification on EZComments 2.0.0.0:
*** pnmigrateapi/Attic/reviews.php Thu Sep 23 21:44:58 2010
--- pnmigrateapi/reviews.php Sat Oct 8 23:47:42 2011
*** 27 ****
! pnModDBInfoLoad('Reviews', 'EZComments/pnmigrateapi/Reviews', true);
--- 27 ----
! pnModDBInfoLoad('Reviews', 'Reviews', true);
*** 35 ****
--- 36,37 ----
$Reviewstable = $pntable['reviews'];
$Reviewscolumn = $pntable['reviews_column'];
$Objecttable = $pntable['objectdata_attributes'];
$Objectcolumn = $pntable['objectdata_attributes_column'];
$Objectcolumn[object_id] AS 'owneruid',
if (empty($item['owneruid'])) {
$item['owneruid'] = 1;
}
'owneruid' => $item['owneruid'],
Show an icon if a comment was created from a mobile device.
Create a new coloumn "mobile" [yes|no]
It would be nice to have a subscription function for the comments of a certain item, so I can follow discussions: You enter your e-mail anyway and you'd only have to set a check for "subscribe to follow-ups" - Nevertheless you'd have to confirm that (Double Opt-in) vi mail. A German court just decided that you have to confirm the subscription so that it's impossible for others to register for you.
After upgrading a Z 1.2.4 site to EZComments 2.0.0, mails are no longer sent when new comments are left.
bug analysis
I've checked the sendmail logs, and there is no attempt to send the mail. No errors logged in PHP logs or error_log of web server. Nothing. just no mail sent.
I've verified in the Mailer module that sending mail from the site does work. I've even set up a test site, enabled News, Enabled EZComments, and hooked it to news. I left a comment, and no mail was sent.
Maybe a nice optional addition via plugin like trackback:
http://www.readwriteweb.com/archives/integrate_twitter_comments_int.php
The URL redirection after submitting a comment in wikula is :
index.php?module=wikula&func=display&tag=PageTitle?
but the correct URL should be :
index.php?module=wikula&tag=PageTitle?
If I submit the form without text, I get only an error message on the top of the page, that is not visible if the page is big or there are many comments already.
It would be nicer if a field would get a focus with a special color like in Formicula for example.
Captcha is working with formicula but under the form of EZComments does not appear the form of Captcha.
Upgrade from v2.0.0 fails, base system is zk135
Result:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ksvw.ezcomments' doesn't exist. Failing Query: "DESCRIBE ezcomments"
Trace:
#0 Ausnahmefehler in C:\Daten\Homepages\webserver\UniServer\www\zk\lib\vendor\Doctrine\Doctrine\Connection.php, Zeile 1082
#1 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\vendor\Doctrine\Doctrine\Connection.php(862): Doctrine_Connection->execute('DESCRIBE ezcomm...', Array)
#2 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\vendor\Doctrine\Doctrine\Import\Mysql.php(143): Doctrine_Connection->fetchAssoc('DESCRIBE ezcomm...')
#3 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\util\DBUtil.php(3526): Doctrine_Import_Mysql->listTableColumns('ezcomments')
#4 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\util\DBUtil.php(3189): DBUtil::metaColumnNames('EZComments')
#5 C:\Daten\Homepages\webserver\UniServer\www\zk\modules\EZComments\lib\EZComments\Installer.php(81): DBUtil::changeTable('EZComments')
#6 [internal function]: EZComments_Installer->upgrade('2.0.0')
#7 C:\Daten\Homepages\webserver\UniServer\www\zk\system\Extensions\lib\Extensions\Api\Admin.php(1024): call_user_func(Array, '2.0.0')
#8 [internal function]: Extensions_Api_Admin->upgrade(Array)
#9 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\util\ModUtil.php(1091): call_user_func(Array, Array)
#10 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\util\ModUtil.php(1199): ModUtil::exec('Extensions', 'admin', 'upgrade', Array, true, NULL)
#11 C:\Daten\Homepages\webserver\UniServer\www\zk\system\Extensions\lib\Extensions\Controller\Admin.php(721): ModUtil::apiFunc('Extensions', 'admin', 'upgrade', Array)
#12 [internal function]: Extensions_Controller_Admin->upgrade(Array)
#13 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\util\ModUtil.php(1091): call_user_func(Array, Array)
#14 C:\Daten\Homepages\webserver\UniServer\www\zk\lib\util\ModUtil.php(1173): ModUtil::exec('Extensions', 'admin', 'upgrade', Array, false, NULL)
#15 C:\Daten\Homepages\webserver\UniServer\www\zk\index.php(78): ModUtil::func('Extensions', 'admin', 'upgrade', Array)
#16 {main}
enable the admin to push all commentsfor a specific item into Dizkus and close down the comment function for that item with a notice that the discussion will be continued in the forum (with link).
Hello Developers,
I can not figure out how anonymous guests can comment. In the options of this module I do not find this setting. I use ezComments in the news publisher.
Now I have created new permissions so that "Unregistered" users have a CommentsAccess. Unfortunately this does not affect comments and only logged in users are allowed to comment on me.
How can I fix this?
Thanks in advance.
User lasker reported this to me:
Could not load the 'extensions' module at 'upgrade'.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd01186e1.ezcomments' doesn't exist. Failing Query: "DESCRIBE ezcomments"
I will check this tomorrow.
It's not possible access to the stats: /comments/admin/modulestats
Error log:
Uncaught PHP Exception BadMethodCallException: "Undefined method 'mostActivePoster'. The method name must start with either findBy or findOneBy!"
Caller controller
EZComments/Controller/AdminController.php
Line 239 in b6525dc
Repository
How you could see, the repository contain "s" at end that the controller haven't.
You must change the name in controller or repository in order to match.
Fatal error: Call to undefined method ModUtil::callHooks() in ../src/modules/EZComments/lib/EZComments/Api/User.php on line 363
Grüße
Torsten
If a user writes a comment, the object (News for example) owner gets an email with the name and mail address of commentor.
this is not really wanted be commentors i think and should be fixed - perhaps as optional setting
Bug Analysis
pnuserapi.php line 326
original: $newcommentuserline? = "$args[anonname] $args[anonmail]";
better: $newcommentuserline? = "$args[anonname]";
Hi @paustian
You must update the version string in composer.json before tagging a new release. The current version string is "4.0.0" but the tag is "4.0.1"
so, to proceed, you should change it to "4.0.2" and then tag/release "4.0.2"
If I create a comment with enabled shorturls the modname will not be saved and so I can not edit the comment in the admin view because it is not displayed.
Hi, would it be nice to preview a comment before submitting it?
Thanx
When EZComments 2.0.0 is hooked to another module and a user has permission to view the module contents but has no persionn to view the comments too, the whole page will not be displayed. Instead the request is redirected to the login screen.
The function EZComments_user_view in pnuser.php (EZComments 2.0.0) always returns with LogUtil::registerPermissionError(), when checkPermission() fails. Other hook modules return empty content, if called as a hook.
EZComments should do so too, i.e. check if the GUI function was called as a hook ($objectid != '') and the return empty content (return false) rather than call LogUtil::registerPermissionError().
Regards
Reiner
Hi,
I try to install the current master branch in Zikula 1.3.2 build 59 and get the following error on install:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'ezcomments.ui_hooks.comments.ui_view' for key 'myindex'
It gives a lot of hook messages.
I have included part of the trace below.
#10 /Users/erik/Documents/Zikula/GitEZComments/src/modules/EZComments/lib/EZComments/Installer.php(28): HookUtil::registerSubscriberBundles(Array)
EZComments currently has a "type" field, but it cannot be configured.
If I remember correctly, the type field is used to distinguish between different comment types (e.g. normal comments, or trackback comments).
Currently it's not possible to add custom types.
Use cases: I currently run 2 EZComments installations in parallel, to handle different types of comments. Using the type field, I could do with one install.
Excellent module otherwise - thanks.
stefaan
Attachments
Change History
comment:1 Changed 3 years ago by Stefaan
Summary changed from Use "type" field to support multiple types of comments to Use "type" field to support configurable types of comments
comment:2 Changed 3 years ago by quan
Milestone set to EZComments 2.0
I do not know for what use case the type field was introduced once - perhaps you can explain how YOU would use the type fields?
comment:3 Changed 2 years ago by StefaanV
My current use case:
I have about 25 sections in my website, with different types of content. Let's take two examples:
This leads to two type of comments:
Blogs: typical comments are permanent - they are part of the discussion, offer additional info. Here it's important to keep the comments
articles: typical comments point out factual errors. Typical workflow: comments are processed, corrections are applied to article, comments are deleted.
To make it easier for editors, I've set up two EZComments systems in parallel: one for the permanent comments, one for the "errors and omissions" (here editors have permsissions to delete comments).
Other use case (probably more widely relevant):
I have about 20 different publication types in pagesetter. These include News, Blogs, etc.
As far as I can tell, EZComments can only classify these as "pagesetter" EZComments (no distinction between publication type). Besides the distinction between comment types mentioned above, I think the following use cases would be really useful:
Allow Editors to manage comments for a specific module or pagesetter publication( e.g. News editor can moderate News comments, "Recipes" editor can moderate recipe comments...
Allow Bloggers to manage comments on their own blog - so bloggers can moderate comments on their own posts.
I see pagesetter/pagemaster as the main module to benefit for this, but I can image it would be useful in photo gallery modules as well (people could manage ezcomments for "their" gallery).
Please correct me if I'm wrong, but I think at this moment EZComments can only distinguish between modules. So my idea was to use the "type" field as an easy way to distinguish between whatever is necessary - I can just add the type field whenever I call the hook.
Hope this makes sense :-)
Practically, it only requires minor modifications to the code.
The "type" field exists, but is currently limited to 2 values (hardcoded). Simply removing those hardcoded values would work already.
optionally, Providing a configuration option allowing admins to enter a list of values would work as well,
optionally, providing a filter in the admin list to only show a specific type would be nice as well.
optionally, Including the type field in the security scheme would make it complete.
thanks,
stefaan
I think this is an EZ Comments issue because the issue doesn't show up in EZ Comments when it is attached to other modules I've used.
When Scribite is enabled for the comments, the icons are shifted lower than the actual button areas, by about the size of the button areas themselves. I have tried this with my own theme as well as the unaltered Andreas08 theme as well as seabreeze.
Would be really nice if we could have blocks for most commented for ex.: videos, blogs, photos, profiles, etc.
Why we have a main, 3.0 and 2.0 branch. The 2.0 branch (EZComments 2.x for Zikula 1.2.x) is okay. But the 3.0 branch is imho at the moment useless, because the branch is also EZComents 3.x. This is confusing. Can we sync the main branch and the 3.0 branch and remove the 3.0 branch afterwards?
Here is a nice Bootstrap 3.0 template for displaying comments.
http://bootsnipp.com/snippets/featured/recent-comments-admin-panel
If I enable pagination and have an article with let's say 10 comments, and limit pagination to 3 comments, only the last three comments show with no pager to the the other comments.
Replies do now go under parent comment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.