Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Newest EZcomments?
-
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
Petzi, you missed two replacements in that cvs file. Do a "search and replace" (case sensitive) and replace Downloads with UpDownload. Line 589 is an example. -
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
Also, since im trying to replace the poor comment system of the updownload module with ezcoments (which is going very well). Im also needing to find a way to get a comment count for that particular download. I tried using the code below, but instead I just got a total of all ezcomments:
Code
// EZComments counter
if (pnModAvailable('EZComments')) {
pnModAPILoad('EZComments', 'user');
$EZComments = pnModAPIFunc('EZComments',
'user',
'getall',
array('modname'=>'UpDownload',
'objectid'=>$row['lid']));
$row['comments'] = count($EZComments);
}
$totalcomments = $row['comments'];
if (pnModGetVar('UpDownload', 'allowcomments')==1) {
if ($totalcomments != 0) {
echo " | <a href=\"".$GLOBALS['modurl']."&req=viewdownloaddetails&lid=$lid\">"._COMMENTS." (".(int)$totalcomments.")</a>";
}
}
Any ideas? -
- Rank: Helper
- Registered: Jan 12, 2004
- Last visit: Jan 20, 2010
- Posts: 590
If you are using the latest ( 0.8 CVS) version of EZComments you can simplify your code a lot calling
Code
$totalcomments = pnModAPIFunc('EZComments',
'user',
'count',
array('module'=>'UpDownload',
'objectid'=>$row['lid']));
For your code I don't see clearly why you are putting the result in $row[comments] then in $totalcomments why not directly in $totalcomments ?
Also your test if (pnModGetVar('UpDownload', 'allowcomments')==1) { will not work because you must disable the UpDownload comments to use EZComments.
Update As Chesnut pointed out the above code had a bug (modname and it should have been module) so just for other browsing this thread I corrected my code wich is now correct
--
Visit my live reef aquarium.
My Amazon wish list. -
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
why would i HAVE TO disable them? they should work independintly. Anyway, i am only using the allowcomments part as a settting for turning them on or off. I have already removed most of the commenting system from the module already. Its already been hacked up to show only what i want, etc. Just need the comment count for EZComments and i should be set. -
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
Here is my new code. But unfortunately i now get zero comments for the results, even though they might have 4 or so.
-
- Rank: Developer
- Registered: Jan 24, 2004
- Last visit: Oct 21, 2009
- Posts: 121
Nono, wrong direction, your first way was right.
Try out this
Code
Regards Petzi
PS: I know this is an old module but I hope I have turned it as far as possible to pnrender for easier working.
--
Petzi-Juist :: ... welcome to my digital world ... -
- Rank: Helper
- Registered: Jan 12, 2004
- Last visit: Jan 20, 2010
- Posts: 590
Why would you use getall now that there is a count function in EZComments userapi ???? I don't see your point here Petzi-Juist, your code is good for the old EZComments .2 or .3 but mine is better for .8. Always use API function when you can !!!
--
Visit my live reef aquarium.
My Amazon wish list. -
- Rank: Developer
- Registered: Jan 24, 2004
- Last visit: Oct 21, 2009
- Posts: 121
Sorry, was the only way I find in a few minutes, then UpDownload is converted to pnRender this function can be a good plugin.
Regards
--
Petzi-Juist :: ... welcome to my digital world ... -
- Rank: Expert
- Registered: Dec 31, 1969
- Last visit: Oct 21, 2009
- Posts: 1437
Petzi's code worked a little better. Now it shows that there is one comment for downloads that have comments and zero for ones that dont. Just doesnt show the correct amount of posts. The one that is said had one actually had 3 comments. Any ideas? API or not, i just want it working. Thanks for all your help. -
**unknown user**
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 1097
Jmv method is better but Mac, your total shows 1 or 0 because the getall returns an array...
Do a
Code
To have a real valid number......
Your error in your count call is that the argument is not modname, it's module
Code
* @param $args['module'] Name of the module to get comments for
* @param $args['objectid'] ID of the item to get comments for -
**unknown user**
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 1097
-
- Rank: Helper
- Registered: Jan 12, 2004
- Last visit: Jan 20, 2010
- Posts: 590
Franky,
as always you are right, I guess a lot of PostNuke devs did that mistake (and if I remember well I already did it several times !!)
--
Visit my live reef aquarium.
My Amazon wish list.
- Moderated by:
- Support
