Feefty's FluxCP Addons Release

Status
Not open for further replies.
Has anyone procured a fix for this voting system to be compatible with Hercules?

 
Has anyone procured a fix for this voting system to be compatible with Hercules?
sad to say none.
default_sad.png
i'm still waiting on that also. xD

 
To anyone having an Unable to vote for the server. Err no. 4  error try this fix. 
/modules/voteforpoints/index.php

Change

case "cash": // insert or update cashpoints $cashpoints_var = "#CASHPOINTS"; $sql = "UPDATE $cp_tbl SET value = value + ? WHERE key = ? AND account_id = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array((int) $res->votepoints, $cashpoints_var, $account_id)); // account doesn't have a record for cashpoints // so we will add a row if ( ! $sth->rowCount()) { $sql = "INSERT INTO $cp_tbl VALUES (0, ?, ?, 2, ?)"; $sth = $server->connection->getStatement($sql); $bind = array($cashpoints_var, $res->votepoints, $account_id); $sth->execute($bind); if ( ! $sth->rowCount()) $errorMessage = sprintf(Flux::message("UnableToVote"), 4); }break;
to

Code:
case "cash":	// insert or update cashpoints	$cashpoints_var = "#CASHPOINTS";	$sql = "UPDATE {$server->loginDatabase}.$cp_tbl SET `value` = value + ? WHERE `key` = ? AND `account_id` = ?";	$sth = $server->connection->getStatement($sql);	$sth->execute(array($res->votepoints, $cashpoints_var, $account_id));    	// account doesn't have a record for cashpoints	// so we will add a row	if ( ! $sth->rowCount())	{	    $sql = "INSERT INTO {$server->loginDatabase}.$cp_tbl VALUES(?,?,0,?)";		$sth = $server->connection->getStatement($sql);		$sth->execute(array($account_id, $cashpoints_var, $res->votepoints));		if ( ! $sth->rowCount())			$errorMessage = sprintf(Flux::message("UnableToVote"), 4);	}break;
 
Last edited by a moderator:
seems like feefty is away from RO community, what if we move those addons to git and start to get community to fix erros?

 
seems like feefty is away from RO community, what if we move those addons to git and start to get community to fix erros?
I'm not sure if there's a problem but Vote for Points has no option to exchange it to Cash/Kafra points in-game directly from the site even if it's already set in addons.php 

Do you have an NPC script that changes vote points to cash? 

 
To anyone having an Unable to vote for the server. Err no. 4  error try this fix. 

/modules/voteforpoints/index.php

Change

case "cash": // insert or update cashpoints $cashpoints_var = "#CASHPOINTS"; $sql = "UPDATE $cp_tbl SET value = value + ? WHERE key = ? AND account_id = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array((int) $res->votepoints, $cashpoints_var, $account_id)); // account doesn't have a record for cashpoints // so we will add a row if ( ! $sth->rowCount()) { $sql = "INSERT INTO $cp_tbl VALUES (0, ?, ?, 2, ?)"; $sth = $server->connection->getStatement($sql); $bind = array($cashpoints_var, $res->votepoints, $account_id); $sth->execute($bind); if ( ! $sth->rowCount()) $errorMessage = sprintf(Flux::message("UnableToVote"), 4); }break;
to

case "cash": // insert or update cashpoints $cashpoints_var = "#CASHPOINTS"; $sql = "UPDATE {$server->loginDatabase}.$cp_tbl SET `value` = value + ? WHERE `key` = ? AND `account_id` = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array($res->votepoints, $cashpoints_var, $account_id)); // account doesn't have a record for cashpoints // so we will add a row if ( ! $sth->rowCount()) { $sql = "INSERT INTO {$server->loginDatabase}.$cp_tbl VALUES(?,?,0,?)"; $sth = $server->connection->getStatement($sql); $sth->execute(array($account_id, $cashpoints_var, $res->votepoints)); if ( ! $sth->rowCount()) $errorMessage = sprintf(Flux::message("UnableToVote"), 4); }break;
Unfortunately still getting the same error, however, the points are at least applying! Thank you!

 
Last edited by a moderator:
To anyone having an Unable to vote for the server. Err no. 4  error try this fix. 

/modules/voteforpoints/index.php

Change

case "cash": // insert or update cashpoints $cashpoints_var = "#CASHPOINTS"; $sql = "UPDATE $cp_tbl SET value = value + ? WHERE key = ? AND account_id = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array((int) $res->votepoints, $cashpoints_var, $account_id)); // account doesn't have a record for cashpoints // so we will add a row if ( ! $sth->rowCount()) { $sql = "INSERT INTO $cp_tbl VALUES (0, ?, ?, 2, ?)"; $sth = $server->connection->getStatement($sql); $bind = array($cashpoints_var, $res->votepoints, $account_id); $sth->execute($bind); if ( ! $sth->rowCount()) $errorMessage = sprintf(Flux::message("UnableToVote"), 4); }break;
to

case "cash": // insert or update cashpoints $cashpoints_var = "#CASHPOINTS"; $sql = "UPDATE {$server->loginDatabase}.$cp_tbl SET `value` = value + ? WHERE `key` = ? AND `account_id` = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array($res->votepoints, $cashpoints_var, $account_id)); // account doesn't have a record for cashpoints // so we will add a row if ( ! $sth->rowCount()) { $sql = "INSERT INTO {$server->loginDatabase}.$cp_tbl VALUES(?,?,0,?)"; $sth = $server->connection->getStatement($sql); $sth->execute(array($account_id, $cashpoints_var, $res->votepoints)); if ( ! $sth->rowCount()) $errorMessage = sprintf(Flux::message("UnableToVote"), 4); }break;
Unfortunately still getting the same error, however, the points are at least applying! Thank you!
What error? Btw, do you issue displaying the current cash points?

 
C9fxIBg.png


 
To anyone having an Unable to vote for the server. Err no. 4  error try this fix. 

/modules/voteforpoints/index.php

Change

case "cash": // insert or update cashpoints $cashpoints_var = "#CASHPOINTS"; $sql = "UPDATE $cp_tbl SET value = value + ? WHERE key = ? AND account_id = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array((int) $res->votepoints, $cashpoints_var, $account_id)); // account doesn't have a record for cashpoints // so we will add a row if ( ! $sth->rowCount()) { $sql = "INSERT INTO $cp_tbl VALUES (0, ?, ?, 2, ?)"; $sth = $server->connection->getStatement($sql); $bind = array($cashpoints_var, $res->votepoints, $account_id); $sth->execute($bind); if ( ! $sth->rowCount()) $errorMessage = sprintf(Flux::message("UnableToVote"), 4); }break;
to

case "cash": // insert or update cashpoints $cashpoints_var = "#CASHPOINTS"; $sql = "UPDATE {$server->loginDatabase}.$cp_tbl SET `value` = value + ? WHERE `key` = ? AND `account_id` = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array($res->votepoints, $cashpoints_var, $account_id)); // account doesn't have a record for cashpoints // so we will add a row if ( ! $sth->rowCount()) { $sql = "INSERT INTO {$server->loginDatabase}.$cp_tbl VALUES(?,?,0,?)"; $sth = $server->connection->getStatement($sql); $sth->execute(array($account_id, $cashpoints_var, $res->votepoints)); if ( ! $sth->rowCount()) $errorMessage = sprintf(Flux::message("UnableToVote"), 4); }break;
Unfortunately still getting the same error, however, the points are at least applying! Thank you!
What error? Btw, do you issue displaying the current cash points?

 
C9fxIBg.png
still getting the error.

 
@Shatotech

Can you post your addon.php?
Mine is a fresh install but still getting the same error after applying that fix. 
same here. after applying latest hercules flux

@Shatotech

Can you post your addon.php?
Mine is a fresh install but still getting the same error after applying that fix. 
That's weird can you right downloading this one. I tested it with a clean fluxcp and it works. I hope it works on you too.
still getting error.

 
@Shatotech

Can you post your addon.php?
Mine is a fresh install but still getting the same error after applying that fix. 
same here. after applying latest hercules flux

> 

@Shatotech

Can you post your addon.php?
Mine is a fresh install but still getting the same error after applying that fix. 
That's weird can you right downloading this one. I tested it with a clean fluxcp and it works. I hope it works on you too.
still getting error.
What error? Tell me so I can check it.

 
@Shatotech

Can you post your addon.php?
Mine is a fresh install but still getting the same error after applying that fix. 
same here. after applying latest hercules flux

>> 

@Shatotech

Can you post your addon.php?
Mine is a fresh install but still getting the same error after applying that fix. 
That's weird can you right downloading this one. I tested it with a clean fluxcp and it works. I hope it works on you too.
still getting error.
What error? Tell me so I can check it.
Error 1.
default_sad.png


 
Here is a rather disgusting, but quick fix for those having problems with the support tickets module. Don't forget to backup your files before applying the following fixes.

Fix department list items appearing twice :

addons/support/modules/support/department.php

change :

<?php if (count($all_dep_res)): ?> <?php foreach ($all_dep_res as $row): ?> <option value='<?= (int) $row->id ?>'><?= htmlspecialchars($row->name) ?></option> <?php endforeach ?> <?php foreach ($all_dep_res as $row): ?> <option value='<?php echo (int) $row->id ?>'><?php echo htmlspecialchars($row->name) ?></option> <?php endforeach ?><?php endif ?>

to :

<?php if (count($all_dep_res)): ?> <?php foreach ($all_dep_res as $row): ?> <option value='<?php echo (int) $row->id ?>'><?php echo htmlspecialchars($row->name) ?></option> <?php endforeach ?><?php endif ?>

Fix addons/support/themes/defalut/support/list.php and addons/support/themes/defalut/support/view.php (Quick and dirty workaround for Flux::Config("ThemeName") not working with add-ons.

lib/Flux.php

change :

public static function config($key, $value = null, $options = array()){ if (!is_null($value)) { return self::$appConfig->set($key, $value, $options); } else { return self::$appConfig->get($key); }}

to :

public static function config($key, $value = null, $options = array()){ if (!is_null($value)) { return self::$appConfig->set($key, $value, $options); } // Disgusting hardcoded fix for Flux::Config("ThemeName") in addons else if ($key == "ThemeName") { return Flux::$sessionData->theme; } else { return self::$appConfig->get($key); }}
This fix is far from being satsfying because it's hardcoded and the issue will repeat with every application parameter passed as an array like ThemeName. I am not that good with PHP and I have actually no idea how to fix this without diving into the core of FluxCP. I'll edit my post if I come up with a better solution though.

06.08.2015 Edit :

I found another error in the support module and a way to fix it in the addon code (even though I suspect the problem comes from FluxCP itself
default_tongue.png
). The error (Trying to get property of non-object in [...]function.php line 306) happens when you try to log in with a wrong username/password. I didn't realize the problem until I turned debug mode on when I started working on an addon.

addons/support/modules/support/functions.php

change :

$group_col = getGroupCol($server);
to :

$group_col = getGroupCol($session->loginAthenaGroup);

06.14.2015 Edit :

Yet another bug, yet another ugly fix for support addon. This fixes the query errors in the ticket list pages happening depending on the current user AccountLevel.

addons/support/modules/list.php

change:

if ($sth->rowCount()){ $i = 0; foreach ($group_res as $row) { if ($i != 0) $sql .=" AND"; $sqlpartial .= " department != ?"; $bind[] = $row->id; $i++; }}

to:

if ($sth->rowCount()){ $sqlpartial = "WHERE"; $i = 0; foreach ($group_res as $row) { if ($i != 0) { $sqlpartial .=" AND"; } $sqlpartial .= " department != ?"; $bind[] = $row->id; $i++; }}

06.16.2015 Edit : Another one. Fix the error when clicking on a ticket to see the detail :

addons/support/modules/support/view.php

change :

$mail = new Flux_Mailer();
to:

$mail = @new Flux_Mailer();
Same fix applies to any other page affected by the issue.

Hope this helps! Also don't hesitate to correct me if you find a more proper (I know there are some) way to fix those issues! ^^

 
Last edited by a moderator:
Topic will be closed. The author has been away from the community for awhile and all this topic gets is "this isn't working..." posts. If you are requesting support for a particular add on, create a support topic in the right section.

 
Status
Not open for further replies.
Back
Top