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
Quote
ORDER BY ".($project_status == 0 ? "tvp.project_votes"
Quote
ORDER BY ".($project_status == 0 || $project_status == 2 ? "tvp.project_votes"
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.
<?php
/*-------------------------------------------------------+
| PHPFusion 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 {
<?php
/*-------------------------------------------------------+
| PHPFusion 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
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.
Quote
/infusions/fusion_voice/infusion.php
/infusions/fusion_voice/voice_admin.php
<?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.";
}
?>
Category Forum
Official releases [Infusions]Labels
None yet
Statistics
0 participants
Notifications
You are not receiving notifications from this thread.
Related Questions