Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

User's Voice

www.php-fusion.co.uk/infusions/marketplace/uploads/image/t_1126.pngThe User's Voice infusion is meant to help website administrators and their members to collaborate efficiently in setting priorities. Whether you use it for development or brainstorming for anything, this infusion will easily allow people to share their thoughts by proposing ideas, comment and promote them with votes.



-- View this Addon --
Take it from me folks, this is a very cool infusion :)
:D Thanks!
good work:)
I just fired up a small task to make some improvements to this. By the looks of it you have done some fixing, Kneeko? Should it not be released as v. 1.1?
It does includes some fixes compared to the one we're using on Next but considering it wasn't released here I just used v1.0 and that's it. What improvements are we talking about?
I found error:

CodeDownload  
Parse error: syntax error, unexpected T_REQUIRE_ONCE in /var/www/virtual/my_site.pl/infusions/fusion_voice_panel/fusion_voice.php on line 1


What should I do?
Download the package again - it's fixed now.

Explanation: At some point one of my editors saved the fusion_voice.php file in a strange format (bad line endings) and although the code inside was OK, it was saved on a single line. Some web servers could handle it, while others couldn't. So I fixed the line endings in that file and updated the infusion in the Add-on DB.

Nota bene: Nothing else is changed so there's no need for others to re-download the infusion but just in case they want to make sure they have a fully working version no matter where they might migrate their website, you will only have to replace fusion_voice.php and that's it.
Minor bug found on line #32 in /infusions/fusion_voice_panel/includes/func.php. It's only about sorting items but on the Accepted page items should be sorted down by the number of votes.

Original code snippet from line #23:

Quote

ORDER BY ".($project_status == 0 ? "tvp.project_votes"


Correct code snippet on line #23:

Quote

ORDER BY ".($project_status == 0 || $project_status == 2 ? "tvp.project_votes"


As this is only a minor bug it will be included in a future release of the infusion. If no other bugs/fixes/suggestions are reported by the end of January, version 1.1 will be published on February 1st.
It works great now. :) Thank you. B)
Regards.

Quote

kneekoo wrote:

Minor bug found on line #32 in /infusions/fusion_voice_panel/includes/func.php. It's only about sorting items but on the Accepted page items should be sorted down by the number of votes.

Original code snippet from line #23:

Quote

ORDER BY ".($project_status == 0 ? "tvp.project_votes"


Correct code snippet on line #23:

Quote

ORDER BY ".($project_status == 0 || $project_status == 2 ? "tvp.project_votes"


As this is only a minor bug it will be included in a future release of the infusion. If no other bugs/fixes/suggestions are reported by the end of January, version 1.1 will be published on February 1st.


This doesn't look like my func.php file

CodeDownload  
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: func.php
| Version: 1.0, August 13, 2011
| Author: Ionescu Vlad (Senzo)
| Co-author: Nicolae Crefelean (kneekoo)
| Co-Co-author: Philip Daly (HobbyMan)
| Website: http://www.phpfusion.ro/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { exit(); }

require_once INFUSIONS."fusion_voice_panel/includes/locale.php";

$voice_settings = dbarray(dbquery("SELECT * FROM ".DB_PREFIX."voice_settings"));

function list_projects($project_status, $items_per_page = 5) {
   $items_per_page = preg_match("#[0-9]+#", $items_per_page) && $items_per_page > 0 ? $items_per_page : 5;
   global $userdata, $locale;
   if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
   $rows = dbcount("(project_id)", DB_PREFIX."voice_projects", "project_status = ".($project_status == 0 ? 1 : $project_status)."");
   if ($rows) {
      $query = dbquery("SELECT tvp.*, tu.user_name FROM ".DB_PREFIX."voice_projects tvp JOIN ".DB_PREFIX."users tu ON tvp.project_user = tu.user_id WHERE tvp.project_status = '".($project_status == 0 ? 1 : $project_status)."' ORDER BY ".($project_status == 0 ? "tvp.project_votes" : "tvp.project_datestamp")." DESC LIMIT ".$_GET['rowstart'].",".$items_per_page);
      echo "<div style='padding: 10px 0 10px 0'>\n";
      while ($p = dbarray($query)) {
         $description = strlen($p['project_description']) >= 500 ? trimlink($p['project_description'], 500) : $p['project_description'];
         $nr_com = dbcount("(comment_id)", DB_COMMENTS, "comment_type='FV' AND comment_item_id='".$p['project_id']."' ");
         $show_vote = iMEMBER ? true : false;
         echo "<table cellpadding='5' cellspacing='3' width='100%' align='center'><tr>\n";
         if ($project_status >= "3") {
            $final_votes = dbquery("SELECT project_votes FROM ".DB_PREFIX."voice_projects WHERE project_id = '".$p['project_id']."'");
            $x = dbarray($final_votes);
            $votes = $x['project_votes'];
            $show_vote = false;
         } else {

Also, my Infusion works but does not show in my admin>infusions drop down menu. Also edit and delete do not work. I have to do this via dB.
@djdubuque - It should work:

CodeDownload  
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: func.php
| Version: 1.0, December 27th, 2011
| Author: Ionescu Vlad (Senzo)
| Co-author: Nicolae Crefelean (kneekoo)
| Co-Co-author: Philip Daly (HobbyMan)
| Website: http://www.phpfusion.ro/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { exit(); }
require_once INFUSIONS."fusion_voice_panel/includes/locale.php";
$voice_settings = dbarray(dbquery("SELECT * FROM ".DB_PREFIX."voice_settings"));

function list_projects($project_status, $items_per_page = 5) {
   $items_per_page = preg_match("#[0-9]+#", $items_per_page) && $items_per_page > 0 ? $items_per_page : 5;
   global $userdata, $locale;
   if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
   $rows = dbcount("(project_id)", DB_PREFIX."voice_projects", "project_status = ".($project_status == 0 ? 1 : $project_status)."");
   if ($rows) {
      $query = dbquery("SELECT tvp.*, tu.user_name FROM ".DB_PREFIX."voice_projects tvp JOIN ".DB_PREFIX."users tu ON tvp.project_user = tu.user_id WHERE tvp.project_status = '".($project_status == 0 ? 1 : $project_status)."' ORDER BY ".($project_status == 0 || $project_status == 2 ? "tvp.project_votes" : "tvp.project_datestamp")." DESC LIMIT ".$_GET['rowstart'].",".$items_per_page);
      echo "<div style='padding: 10px 0 10px 0'>\n";
      while ($p = dbarray($query)) {
         $description = strlen($p['project_description']) >= 500 ? trimlink($p['project_description'], 500) : $p['project_description'];
         $nr_com = dbcount("(comment_id)", DB_COMMENTS, "comment_type='FV' AND comment_item_id='".$p['project_id']."' ");
         $show_vote = iMEMBER ? true : false;
         echo "<table cellpadding='5' cellspacing='3' width='100%' align='center'><tr>\n";
         if ($project_status >= "3") {
            $final_votes = dbquery("SELECT project_votes FROM ".DB_PREFIX."voice_projects WHERE project_id = '".$p['project_id']."'");
            $x = dbarray($final_votes);
            $votes = $x['project_votes'];
            $show_vote = false;
         } else {

Quote

djdubuque wrote:

This doesn't look like my func.php file

As Borek said, it should work. I only posted a fragment of line #23 because I wanted to highlight the specific change. If you want to apply the update simply use the search feature of your editor and you will find the fragment I mentioned.

Quote

djdubuque wrote:

Also, my Infusion works but does not show in my admin>infusions drop down menu. Also edit and delete do not work. I have to do this via dB.

This infusion has been tested quite intensively and apart from the "unexpected T_REQUIRE_ONCE" bug reported earlier by Borek I have no reasons to believe the infusion would act this strange. Make sure your files have all been transfered properly by FTP, because partial transfers sometimes happen and in such cases it is normal to experience unexpected behaviour from the PHP scripts involved.

The files responsible for adding the link in the drop-down and the edit and delete features are:

Quote

/infusions/fusion_voice/infusion.php
/infusions/fusion_voice/voice_admin.php

1. Re-upload those two files (or all) AND make sure you don't have partial transfers.
2. The link to the infusion (drop-down + the infusions tab in Admin Panel) is only created when you infuse. If you defuse, all the data of the infusion will be deleted, so if you have suggestions do not defuse. Instead, preview this code in a custom page:
CodeDownload  
<?php
$result = dbquery("INSERT INTO ".DB_ADMIN." (admin_rights, admin_image, admin_title, admin_link, admin_page) VALUES ('FVP', '', 'User's Voice', '".INFUSIONS."fusion_voice_panel/voice_admin.php', '5')");
if ($result) {
   echo "Link successfully added to the infusions section.";
} else {
   echo "The link could not be added to the infusions section. Please check the <a href='".ADMIN."errors.php".$aidlink."'>error log</a> for details.";
}
?>

I forgot to mention that version 1.1 is available since February, as promised a few weeks ago.

Changes:
1. Fixed parse error in fusion_voice_panel/fusion_voice.php (bad line endings)
2. Fixed item sorting on Accepted page (fusion_voice_panel/includes/func.php)

There's no need to overwrite all the files or to re-infuse. You only need to overwrite the two files mentioned above and that will take care of it. I'll be here for more bug reports, improvement suggestions or praises. :)
Thread Information
Author
Replies
15 posts
Views
9,368 times
Last Post
Last updated on 8 years ago
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Users who participated in discussion: Homdax, kneekoo, HobbyMan, jikaka, Borek, djdubuque