Jump to content
  • 0

Vote for Points from JayPee problem


mightyryan

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   2
  • Joined:  10/03/12
  • Last Seen:  

Hi guys, does anybody fix the error about jaypee ad ons V4P, I did the steps and when I came to the problem about adding voting sites, I tried a simple account to test to vote,When I go to the Vote 4 Points, I cannot see the voting sites, If anyone fixed these issue, I would be glad/thankful if you share it here.

Thanks much!

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Did you add the query table from /addons/voteforpoints/schemas/ to your DB?

Edit: Check your /addons/voteforpoints/config/access.php too! See if you allow AccountLevel::NORMAL to access.

<?php
/*
FluxCP Vote For Points
Developed By: JayPee Mateo
Email: [email protected]
*/
return array(
'modules' => array(
 'voteforpoints' => array(
		'index'  => AccountLevel::NORMAL,
		'vote'   => AccountLevel::NORMAL,
		'image'  => AccountLevel::NORMAL,
		'add'   => AccountLevel::ADMIN,
		'edit'   => AccountLevel::ADMIN,
		'delete'  => AccountLevel::ADMIN,
		'list'   => AccountLevel::ADMIN,
 ),
),
)
?>

Edited by darristan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

it would be better if you post the error of your v4p

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   2
  • Joined:  10/03/12
  • Last Seen:  

Hello, I did add the the sql files to my database,

here is in my access.php

'modules' => array(

'voteforpoints' => array(

'index' => AccountLevel::NORMAL,

'vote' => AccountLevel::NORMAL,

'image' => AccountLevel::NORMAL,

'add' => AccountLevel::ADMIN,

'edit' => AccountLevel::ADMIN,

'delete' => AccountLevel::ADMIN,

'list' => AccountLevel::ADMIN,

),

),

)

?>

here is the screenshot , I cannot see the voting site I added

post-8458-0-65778700-1350216918_thumb.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Check your config/groups.php and check:

<?php
final class AccountLevel {
/* Corresponds to the different 'level' attribrutes */
const ANYONE =   -2;
const UNAUTH =   -1;
const NORMAL =    0;
const LOWGM  =    1;
const HIGHGM =    2;
const ADMIN  =   99;
const NOONE  = 9999;
....

See if NORMAL is level 0 and check your server is default account registration = Level 0.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   2
  • Joined:  10/03/12
  • Last Seen:  

where can I find config/groups.php?

you mean level.php, its level here in my cp

I checked it and here is my level.php

<?php

final class AccountLevel {

const UNAUTH = -1;

const ANYONE = -2;

const NORMAL = 0;

const HELPER = 10;

const LOWGM = 20;

const MIDGM = 40;

const HIGHGM = 60;

const ADMIN = 99;

const NOONE = 9999;

}

?>

When I also tested admin, it it still the same, It doesn't have the voiting sites. but when admin will go to edit, it will shows the voiting site and can be edited/deleted

Edited by mightyryan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

And check your RO db and see if ID is level 0 first?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   2
  • Joined:  10/03/12
  • Last Seen:  

you mean the account's level? yes, When I also tested admin, it it still the same, It doesn't have the voiting sites. but when admin will go to edit, it will shows the voting site and can be edited/deleted.

bump, please help

Does it mean if that the SQL files should be added in the logindb with the flux cp files? or it will be ok to be with the ROdb? because I installed my CP files in the ROdb

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Go to addons/voteforpoints/modules/voteforpoints and in index.php

Replace the code there with this code:

<?php //A login is required
include ('function.php');$this->loginRequired();
//This will list the sites
$vp = Flux::config('FluxTables.Sites'); 
$vp_voter = Flux::config('FluxTables.Voters'); 
$serverLogDB = $server->loginDatabase;
$vp_voter = Flux::config('FluxTables.Voters'); 
$vp_logs = Flux::config('FluxTables.Logs');  
$serverObj = $server->connection;$sql = "SELECT site_id,site_name,address,points,blocking_time,banner,banner_url FROM {$server->loginDatabase}.{$vp}";
$sth = $server->connection->getStatement($sql);
$sth->execute();
$vp = $sth->fetchAll();
$account_idz = $session->account->account_id;
$current_time= date("Y-m-d G:i:s",time());
$ip_address = 0;if(Flux::config('IP_BLOCKING')) 
$ip_address = $_SERVER['REMOTE_ADDR']; 
$sql = "SELECT points FROM {$server->loginDatabase}.{$vp_voter} WHERE account_id=?";
$sth = $server->connection->getStatement($sql);$sth->execute(array($session->account->account_id));
$vp_voter = $sth->fetch();
$curr_points = $vp_voter->points;
function isBlock($account_idz,$site_id,$current_time,$ip_address,$serverLogDB,$vp_logs,$serverObj){ if($ip_address!=0) { 
$sql = "SELECT `rtid`,`unblock_time`,`ip_address` FROM {$serverLogDB}.{$vp_logs} WHERE f_site_id=? AND unblock_time>? AND ip_address=? ORDER BY unblock_time ASC LIMIT 1"; 
$sth = $serverObj->getStatement($sql); 
$sth->execute(array($site_id,$current_time,$ip_address)); 
$ip_check = $sth->fetchAll(); 
$diff_time = strtotime($ip_check[0]->unblock_time)-strtotime(date("Y-m-d G:i:s",time())); 
if(!empty($ip_check)) 
return strtotime($ip_check[0]->unblock_time); } 
$sql = "SELECT `unblock_time` FROM {$serverLogDB}.{$vp_logs} WHERE account_id=? AND f_site_id=?"; 
$sth = $serverObj->getStatement($sql); 
$sth->execute(array($session->account->account_id,$site_id)); 
$account_check = $sth->fetch(); 
if(!empty($account_check)) 
$diff_time = strtotime($account_check->unblock_time)-strtotime(date("Y-m-d G:i:s",time())); 
else 
$diff_time = 0; 
if($diff_time>0) 
return strtotime($account_check->unblock_time); 
else 
return 0; 
return strtotime($account_check->unblock_time);}
?>

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   8
  • Joined:  03/03/12
  • Last Seen:  

Go to addons/voteforpoints/modules/voteforpoints and in index.php

Replace the code there with this code:

<?php //A login is required
include ('function.php');$this->loginRequired();
//This will list the sites
$vp = Flux::config('FluxTables.Sites');
$vp_voter = Flux::config('FluxTables.Voters');
$serverLogDB = $server->loginDatabase;
$vp_voter = Flux::config('FluxTables.Voters');
$vp_logs = Flux::config('FluxTables.Logs');  
$serverObj = $server->connection;$sql = "SELECT site_id,site_name,address,points,blocking_time,banner,banner_url FROM {$server->loginDatabase}.{$vp}";
$sth = $server->connection->getStatement($sql);
$sth->execute();
$vp = $sth->fetchAll();
$account_idz = $session->account->account_id;
$current_time= date("Y-m-d G:i:s",time());
$ip_address = 0;if(Flux::config('IP_BLOCKING'))
$ip_address = $_SERVER['REMOTE_ADDR'];
$sql = "SELECT points FROM {$server->loginDatabase}.{$vp_voter} WHERE account_id=?";
$sth = $server->connection->getStatement($sql);$sth->execute(array($session->account->account_id));
$vp_voter = $sth->fetch();
$curr_points = $vp_voter->points;
function isBlock($account_idz,$site_id,$current_time,$ip_address,$serverLogDB,$vp_logs,$serverObj){ if($ip_address!=0) {
$sql = "SELECT `rtid`,`unblock_time`,`ip_address` FROM {$serverLogDB}.{$vp_logs} WHERE f_site_id=? AND unblock_time>? AND ip_address=? ORDER BY unblock_time ASC LIMIT 1";
$sth = $serverObj->getStatement($sql);
$sth->execute(array($site_id,$current_time,$ip_address));
$ip_check = $sth->fetchAll();
$diff_time = strtotime($ip_check[0]->unblock_time)-strtotime(date("Y-m-d G:i:s",time()));
if(!empty($ip_check))
return strtotime($ip_check[0]->unblock_time); }
$sql = "SELECT `unblock_time` FROM {$serverLogDB}.{$vp_logs} WHERE account_id=? AND f_site_id=?";
$sth = $serverObj->getStatement($sql);
$sth->execute(array($session->account->account_id,$site_id));
$account_check = $sth->fetch();
if(!empty($account_check))
$diff_time = strtotime($account_check->unblock_time)-strtotime(date("Y-m-d G:i:s",time()));
else
$diff_time = 0;
if($diff_time>0)
return strtotime($account_check->unblock_time);
else
return 0;
return strtotime($account_check->unblock_time);}
?>

sir this works for me now but upon click the sites it will show. "Proxy is not allowed" - how to fix that one? this was happen last week I don't now why. it was fine and working on the past days but now that was my problem

Link to comment
Share on other sites

×
×
  • Create New...