bijan69 0 ارسال شده در آذر 91 سلام من افزونه امتیاز دهی به نظرات k2 رو از سایت زیر دانلود کردم http://extensions.joomla.org/extensions/extension-specific/k2-extensions/11511 ولی برای نصب یه فایل متنی گذاشته که اصلا متوجه نمیشم چی می خواهد فایل متنی(راهنمای نصب) : The component is intended to work with the K2 component already installed[undefined=undefined]. Some post-installation customization is required: 1. Edit the file configuration.php (used by the Ajax programs) to provide the correct values for your mysql database. 2. Add two fields to the jos_k2_comments table: ALTER TABLE `jos_k2_comments` ADD COLUMN `approved` TINYINT(1), ADD COLUMN `ip` CHAR(20); If you use a different Joomla database prefix, substitute it for "jos". 3. Included with this component is the file tc_comments_patch_k2_v254.zip, which contains patches to version 2.5.4 of K2 for steps 4 and 5 below, and a K2 template, tc_comments, which contains steps 6 and 7. If you apply this patch, the thumbs and "report" link will appear if you select the tc_comments template for the K2 category. 4. Edit the file components/com_k2/models/item.php. At about line 827, you should see some code that looks like this: if (!$user->guest) { $row->userID = $user->id; $row->commentEmail = $user->email; $row->userName=$user->name; } Insert this code below: $ip = $_SERVER['REMOTE_ADDR']; $db = & JFactory::getDBO(); /* this is commented out because this attempt to query information_schema doesn't seem to work for me. you might have better luck. $query = "SELECT * FROM information_schema.TABLES WHERE TABLE_NAME = '#__k2_comments_blacklist'"; $db->setQuery($query); $result = $db->loadresult(); if ($result>0){ */ // there IS a blacklist table . $query = "SELECT * FROM #__k2_comments_blacklist WHERE ip = '" . $ip . "'"; $db->setQuery($query); $result = $db->loadresult(); if ($result>0){ echo JText::_('Your IP address is blacklisted.'); $mainframe->close(); } // } ----- At about line 899 of the same file, you should see this code: if($user->gid > 23) { $row->published = 1; } } } Insert these two line after it: $row->approved = 0; $row->ip = $ip; The following line should be: if (!$row->store()) { 5. Edit the file administrator/components/com_k2/tables/k2comment.php. At about line 24, you should see this line: var $published = null; Insert these two lines below: var $approved = null; var $ip = null; 6. Add the following near the beginning of the item.php file of your K2 template (after the first "?>"): 7. Insert the following in the item.php file of your K2 template where you want the thumbs and the "Report Abuse" link to appear. (Suggestion: below " <?php echo $comment->commentText; ?>" around line 620.) <?php $db = &JFactory::getDBO(); $query = "SELECT COUNT(*) FROM #__k2_comments_votes " . "WHERE comment = " . $comment->id . " AND vote = 1"; $db->setQuery( $query ); $up_count = $db->loadResult(); $query = "SELECT COUNT(*) FROM #__k2_comments_votes " . "WHERE comment = " . $comment->id . " AND vote = 0"; $db->setQuery( $query ); $down_count = $db->loadResult(); $query = "SELECT COUNT(*) FROM #__k2_comments_reported " . "WHERE comment = " . $comment->id; $db->setQuery( $query ); $reported = $db->loadResult(); ?> <?php echo $up_count; ?> <?php echo $down_count; ?> <?php if (!$comment->approved && !$reported) { ?> Report Abuse <?php } ?> 8. A php script is included to provide a report to the system administrator: component/tc_comments/cron/tc_comments.php It is intended to be run as a cron job. You'll want to modify the $baseurl on line 5. [/undefined] اگر کسی از نحوه نصب این افزونه اطلاعی داره لطفا یگه که چه جوری نصب میشه ؟؟؟ نقل قول به اشتراک گذاری این ارسال لینک به ارسال به اشتراک گذاری در سایت های دیگر