0 Members and 1 Guest are viewing this topic.

*

Benoitc64

  • **
  • 75
  • osDate Version: osDate Evo v1.2
polls for osdate evo
« on: December 27, 2017, 05:04:49 AM »
I've modified an old polls for osdate 2.1.9.

The modification is fine for osdate evo.

Need some adjustment , it cause some issue in the layout:

See screens

When nobody is log on the site i have this error that appear at the top

Input array has 1 params, does not match query: 'SELECT count(*) FROM osdate_pollips WHERE ip = ? and pollid = ? '
that cause a template error. The Our members, Recently active members and the newest profiles are at the bottom.


Everything is fine when a user is logged in.
Any help will be appreciated.
osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

Benoitc64

  • **
  • 75
  • osDate Version: osDate Evo v1.2
Re: polls for osdate evo
« Reply #1 on: December 27, 2017, 05:22:40 AM »
here are the screens of site

osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

Pharg

  • *****
  • 3,153
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #2 on: December 27, 2017, 05:48:28 AM »
Hi Benoitc64,

I will have a look at it soon and see if I can get the same error.

By the way, osDateEvo doesn't have leftside menu that's responsive and won't work correctly, change it
in the admin under global settings where it is suppose to be set to top only

Find User Menu to be used top NOT side menu.

Think I need to remove those settings in the database so it stays as Top for the members.
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

Pharg

  • *****
  • 3,153
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #3 on: December 27, 2017, 06:56:48 AM »
Hi Benoitc64,

There seems to be a few mismatched sql files, very different to osDateEvo

I will ask CBG to look at it, this is more his thing to work out.
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

CBG

  • *****
  • 960
    • osDate Forum
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #4 on: December 27, 2017, 09:30:56 AM »
Hi Benoitc64,

You said it from osDate 2.1.9 and it is modified.
What changes did you make?

As it on line 43 of Polls.php you are passing the session UserID, as no one logged in, it through a mismatch, as it not getting all the details it needs.
The problem seems to start on lines 43 to 45 of polls.php

However the SQL code is ip = ? for that answer, it is giving a UserID and not the user IP

Are you only wanting logged in members to vote?
If not let me know what you trying to do and I see if I can help.
« Last Edit: December 27, 2017, 09:46:24 AM by CBG »
Regards,
CBG (Garry)
PHP: 5.x and 7.x | MySQL: 10.1.31-MariaDB-cll-lve

*

Benoitc64

  • **
  • 75
  • osDate Version: osDate Evo v1.2
Re: polls for osdate evo
« Reply #5 on: December 27, 2017, 05:01:27 PM »
THe script is the same that's it from 2.1.9.

The only change i've made is change $db->  to $osDB

Yes  the ip = ? is from the old version this is the UserID for prevent user to vote more than once.

The vote will be only accessible when the user is logon. -
     If the user has already vote, that display the result for the poll
     if the user has not vote that display the voting choice.
 

In the leftcolumn.tpl  I've modified the poll part for


{if $smarty.session.UserId != '' && $poll_data|@count > 0 }
   {include file="polls.tpl"}
   <br />
{/if}


osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

CBG

  • *****
  • 960
    • osDate Forum
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #6 on: December 27, 2017, 05:24:09 PM »
Hi,

I will try and sort. Should be later today, or tomorrow morning.
Regards,
CBG (Garry)
PHP: 5.x and 7.x | MySQL: 10.1.31-MariaDB-cll-lve

*

CBG

  • *****
  • 960
    • osDate Forum
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #7 on: December 27, 2017, 05:55:31 PM »
Hi Benoitc64,

Try these updated .php files.
I added an if/else to make sure the UserID was set if not it, exit and if it is, it runs.
Regards,
CBG (Garry)
PHP: 5.x and 7.x | MySQL: 10.1.31-MariaDB-cll-lve

*

Benoitc64

  • **
  • 75
  • osDate Version: osDate Evo v1.2
Re: polls for osdate evo
« Reply #8 on: December 27, 2017, 06:29:58 PM »
After update those files,  the website is blank screen.
osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

CBG

  • *****
  • 960
    • osDate Forum
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #9 on: December 27, 2017, 06:34:12 PM »
Hi,

Try these updated ones.
Regards,
CBG (Garry)
PHP: 5.x and 7.x | MySQL: 10.1.31-MariaDB-cll-lve

*

Benoitc64

  • **
  • 75
  • osDate Version: osDate Evo v1.2
Re: polls for osdate evo
« Reply #10 on: December 27, 2017, 06:53:16 PM »
hi , with the new file , when signoff everything appear fine, but when we sign on  the site is blank.

osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

CBG

  • *****
  • 960
    • osDate Forum
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #11 on: December 27, 2017, 08:27:19 PM »
Hi,

Try these .php files.
If not I will need to look at it tomorrow and test it out.
Regards,
CBG (Garry)
PHP: 5.x and 7.x | MySQL: 10.1.31-MariaDB-cll-lve

*

Benoitc64

  • **
  • 75
  • osDate Version: osDate Evo v1.2
Re: polls for osdate evo
« Reply #12 on: December 28, 2017, 12:05:52 AM »
Hi, it don't works :(

the problem seems to be with the $_SESSION['UserId']

The global var  aren't set when nobody  is online that cause a problem with the sql statement.

osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

CBG

  • *****
  • 960
    • osDate Forum
  • osDate Version: osDateEvo v1.3
Re: polls for osdate evo
« Reply #13 on: December 28, 2017, 09:56:01 AM »
Hi,

Ok, I think I have the answer now, and I have tested this, and works fine for me.

Step 1:
Restore the original polls.php and votehere.php files, you posted.

Step 2:
Open init.php

Find:
Code: [Select]
if (!isset($_SESSION['AdminId'])) {
include_once( 'polls.php' );
include_once( 'stories.php' );
include_once( 'news.php' );
if ($config['display_list_of_events'] > 0) include_once( 'showevents.php' );

}

Change to:
Code: [Select]
if (!isset($_SESSION['AdminId'])) {
// include_once( 'polls.php' );
include_once( 'stories.php' );
include_once( 'news.php' );
if ($config['display_list_of_events'] > 0) include_once( 'showevents.php' );

}

Directly below add:
Code: [Select]
if (isset($_SESSION['UserId'])) {
    include_once( 'polls.php' );
}

This should now look like

Code: [Select]
if (!isset($_SESSION['AdminId'])) {
// include_once( 'polls.php' );
include_once( 'stories.php' );
include_once( 'news.php' );
if ($config['display_list_of_events'] > 0) include_once( 'showevents.php' );

}

if (isset($_SESSION['UserId'])) {
    include_once( 'polls.php' );
}
Regards,
CBG (Garry)
PHP: 5.x and 7.x | MySQL: 10.1.31-MariaDB-cll-lve

*

Benoitc64

  • **
  • 75
  • osDate Version: osDate Evo v1.2
Re: polls for osdate evo
« Reply #14 on: December 28, 2017, 03:30:58 PM »
Thanks  , it works perfectly.

if you want , you can include it in the new package of osdate evo :)

osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |