Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: [ADD-ON] AJAX POLLS for sNews 1.6  (Read 4970 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
[ADD-ON] AJAX POLLS for sNews 1.6
« on: August 30, 2009, 03:04:23 AM »

Howdy Folks... it's been some time since I contributed anything new for the good of sNews.
Note of Thanks - to 'Gnilp' (+ karma) for providing me with a 1.6 file-set as a working reference.
This one is the 1.6 version of the AJAX POLLS for sNews 1.7 contributed by MDJ.

Working Demo: with my somewhat neglected sNews 1.6 Modular project.

You can download the Polls package for sNews 1.6 complete with full instructions contained in the readme file for installation and directions for modifications to existing snews files. LAST UPDATED: September 08, 2010 - Polls for sNews 1.6

If you are fairly comfortable with searching through the index.php and snews.php files, and making changes to them, then the instructions in the included readme file will take you through it all.

NOTE: I strongly advise against modifying the package or deviating from the instructions provided if you want it to work as intended... unless you possess the PHP and MySQL skills required to understand how the changes you make will affect the operation of this package.

As is the case with all free mods and addons... no warranty or guarantee is expressed, alluded to or provided.
You are on your own.
But it does work fine for me... as intended. Enjoy.  8)
« Last Edit: September 08, 2010, 06:25:06 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #1 on: August 31, 2009, 04:00:28 PM »

How nice of you, Dougie ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #2 on: September 01, 2010, 03:00:06 AM »

Property of very awesome ... Thank you for the poll fucnction ..Helped you I wish to clarify
I want to do I create a new database I'm going to up the file (sqlofpoll.sql).
 because I do not want merged tables of CMS Snews AND POLL METHOD.

So how I'm going to edit and change the way that I mentioned in the file README.TXT

Just a reminder of how it will be displayed on the homepage without what we set php function like/
<?php poll_fuction() >

& Thank you for the method ... I've been looking for him since a year ... I wish I could explain to me the way


Logged
“Fifty years of programming language research, and we end up with C++?”

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #3 on: September 01, 2010, 10:40:31 PM »

up mr keyrocks i need a solution up please ........
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #4 on: September 02, 2010, 04:37:29 AM »

up mr keyrocks i need a solution up please ........

Sorry... I cannot offer a solution because I do not know what you need.
You will have to explain better what you need.
Please write your explanation in your own language first then translate it to English on Google Translator... maybe I will be able to understand it better.
What is your language?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #5 on: September 02, 2010, 08:22:29 AM »

First, Thanks for the reply ... What I want to do is that I want to add in my snews1.6

mod_poll  ...So I have to follow the instructions mentioned in the file readme.txt

so We origin had to add tables of mod poll in the database of snewS1.6 .

But I do not want it I want to separate between the database of poll and db of cms
so we have to edit 
# Fetches database connection values, shared with snews.php
in the file poll_process.php.

you Reported in file readme   That we must delete the // DATABASE VARIABLES
complete. in snews.php  .
But iwant to be // DATABASE VARIABLES in snews.php
and // DATABASE VARIABLES in setmeup.php.

if you did not understand my problem well I will explain you more again ... Thank you and sorry for the inconvenience mr.keyrocks...Incidentally I am from Morocco



« Last Edit: September 02, 2010, 08:25:34 AM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #6 on: September 02, 2010, 03:20:58 PM »

You can leave the database function for sNews in snews.php and not have a setmeup.php file.

If you want to have snews tables in one database, and the poll tables in another database, try and made the following change:
In poll_process.php:

1. Replace this...
Code: [Select]
<?php

# Fetches database connection values, shared with snews.php
include('../setmeup.php');
$db mysql_connect(db('dbhost'), db('dbuname'), db('dbpass'));
mysql_select_db(db('dbname')) or die(db('dberror'));

?>


with this....
Code: [Select]
<?php

# Database settings for Polls, separate from sNews
$server 'localhost';
$dbuser 'database_username';
$dbpass 'database_password';
$dbname 'database_name';
$dbprefix '';

define('_PRE',$dbprefix);
$conn mysql_connect($server,$dbuser,$dbpass) or die(mysql_error());
mysql_select_db($dbname,$conn);

?>


2. Search the same file for db('prefix') in 2 places, and replace it with _PRE

And... see how that works.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #7 on: September 02, 2010, 11:59:58 PM »

There is a problem in homepage was this sentence over:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/aljazeer/public_html/index.php:1) in /home/aljazeer/public_html/index.php on line 1

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/aljazeer/public_html/index.php:1) in /home/aljazeer/public_html/index.php on line 1



in line 1 of index.php There is this php tag
      <?php session_start(); include('snews__poll.php'); include("mod_poll/poll_functions.php"); ?>

I think it should be integrated into a file poll_functions.php  and poll_process.php

Because the information of database  # Database settings for Polls,

 in the file poll_process.php    not   poll_functions.php  

We must therefore create a single file that can place fucntions poll  and database setting in one file. like Snews.php






    
« Last Edit: September 03, 2010, 12:06:53 AM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #8 on: September 03, 2010, 05:26:03 AM »

in line 1 of index.php There is this php tag
      <?php session_start(); include('snews__poll.php'); include("mod_poll/poll_functions.php"); ?>

I think it should be integrated into a file poll_functions.php  and poll_process.php
Because the information of database  # Database settings for Polls, in the file poll_process.php    not   poll_functions.php  
We must therefore create a single file that can place functions poll  and database setting in one file. like Snews.php

The package I provided was created to be used as the instructions describe.
I am willing to help with problems you might experience while using it as intended.
You can change or modify anything you wish but I do not have time to experiment or trouble-shoot issues you run into along the way.
Good Luck.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #9 on: September 08, 2010, 12:32:38 PM »


Anyway, mr. KeyRockS .is there some member can help me.  when I click, Create a Poll, I get, "Error Error, poll does not exist." & i check the db('prefix') in file poll_process its in right way.
can some body upload last update of poll mod...  just one thing ..i found the same problemm here http://www.mdj.us/snews-cms/hacks-mods/snews-ajax-polls-mod-now-available/   look at the comments.
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #10 on: September 08, 2010, 06:22:48 PM »


Anyway, mr. KeyRockS .is there some member can help me.
When I click, Create a Poll, I get, "Error Error, poll does not exist." & i check the db('prefix') in file poll_process its in right way.
I found (have) the same problem here http://www.mdj.us/snews-cms/hacks-mods/snews-ajax-polls-mod-now-available/   look at the comments.

Can some body upload last update of poll mod...

I just completed a fresh install of the polls package with a fresh, default install of sNews 1.6.
I did not get any  "Error Error, poll does not exist." message.

However, I did notice that the instructions I provided in the package's README.txt file was missing some important things in it.
So I revised the README.txt file to make it much clearer, and added some comments in a few of the files as well.

NOTE: The package available using the link in my lead post has been updated as of today,
           It is functioning as intended, provided you take the steps and use it as instructed.

I strongly advise against modifying the package or deviating from the instructions provided if you want it to work as intended... unless you possess the PHP and MySQL skills required to understand how the changes you make will affect the operation of this package.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #11 on: September 10, 2010, 04:03:14 AM »

Just to remind you. I said I want to have snews tables in one database, and the poll tables in another database, try and made the following change. it means that we most delete file setmeup.php.
So you have given me this code

Code: [Select]
# Database settings for Polls, separate from sNews
$server = 'localhost';
$dbuser = 'database_username';
$dbpass = 'database_password';
$dbname = 'database_name';
$dbprefix = '';

define('_PRE',$dbprefix);
$conn = mysql_connect($server,$dbuser,$dbpass) or die(mysql_error());
mysql_select_db($dbname,$conn);

 to change this code in a file poll_process.php

Code: [Select]
# Fetches database connection values, shared with snews.php
include('../setmeup.php');
$db = mysql_connect(db('dbhost'), db('dbuname'), db('dbpass'));
mysql_select_db(db('dbname')) or die(db('dberror'));
And then I change   (php session_start)  this code ''in file index.php":

<?php session_start(); include('snews.php'); ?>

to this:
Code: [Select]
<?php session_start(); include('setmeup.php'); include('snews.php'); include("mod_poll/poll_functions.php"); ?>Means that it has added include setmeup.php o php session start.

But the problem remained as it is.

I think that the problem is complete in a conncet between sql and the mod files.

AND HAvE YOU CHECK THIS FUNCTION  
 
// DO POLLS
 IN FILE poll_admin.php.  JUST LOOK if its allright.

thanks
Logged
“Fifty years of programming language research, and we end up with C++?”

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #12 on: September 10, 2010, 05:19:21 AM »

As I noted above... I recommend that you use the mod as it was intended.
That means putting the polls tables in the snews database and installing the mods as instructed in the README.txt file in the download package.
I cannot understand why you would need to have the polls and snews tables in different databases.
It doesn't make either one run better.

The change that I suggested you "try" is just that... a suggestion only. I did not suggest it work and I would expect you would have to make other changes in all of the polls files. If you want the polls mod to work differently for you than the way it is provided in the package, then it is up to you to figure out how to make it work.

AND HAvE YOU CHECK THIS FUNCTION   // DO POLLS  IN FILE poll_admin.php.  JUST LOOK if its allright.

In the file I have it looks OK to me and it works OK too.
« Last Edit: September 10, 2010, 05:46:26 AM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adminphp

  • Full Member
  • ***
  • Karma: 4
  • Posts: 150
  • you must be a great snewser .
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #13 on: September 10, 2010, 06:28:43 PM »

Thank you for your comment .. I just want to separate the database of snews and poll mod. so i just not want to mix tables.of cms & mods
But the solution of the tables its  easy.
Thank you mr.keyrocks and every body here in forum for the replies Regards.

-  So I Suggest you an excellent idea (Can we add all mods to snews1.6 ..Upgrade to become an excellent cms)
Now, I think, that even if one has to download the snews 1.6 version. Will be not like it. him just if he add  the full-ons mods.


« Last Edit: September 10, 2010, 07:01:29 PM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

nekto

  • Newbie
  • *
  • Karma: 0
  • Posts: 1
Re: [ADD-ON] AJAX POLLS for sNews 1.6
« Reply #14 on: January 16, 2011, 05:27:25 PM »

Hi all,

Does anybody know how I can fix this?



It appears after clicking "View results" link, or voting. After refreshing page, correct chars will display.

I do understand this is some-like related to char-set issue. What I really don't know is where to change it.

Thanks in advance!
Logged
Pages: [1] 2