Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2018-03-09 06:42:21

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: geo_vote

In the Database are no new tables.
And in the File for Textpattern is drwxr-xr-x / 755. Same how my old website.

Only the MySQL-version is other:
new website: MySQL: 5.6.19-67.0-log
old website: MySQL: 4.1.22-log

Plugins:
new Website:
Aktive Plugins: com_connect-4.6.0-beta, yab_email-0.7, smd_wrap-0.20, rah_gps-0.1, soo_toc-0.1.5, rah_external_output-1.1.0, soo_image-1.0.b.9, soo_plugin_pref-0.2.3, soo_txp_obj-1.1.2

old website:
Aktive Plugins: hak_article_image-0.6.3, rss_thumbpop-0.7m, glx_image_count-0.2, wet_thumbfilter-0.6, asy_wondertag-0.5, zem_contact_reborn-4.0.3.20m, zem_contact_lang-de-4.0.3.6m, pap_contact_cleaner-0.1, smd_if-0.81, chh_if_data-0.10, smd_gallery-0.52, mg_setheader-0.1, dtj_obfuscated_email-0.3, wet_slimpattern-0.4.1, soo_toc-0.1.4, wyn_recent_comments-0.1, smd_wrap-0.20, rah_gps-0.1, stm_article_order-0.2, upm_image-0.6.2, soo_image-1.0.b.8, upm_textile-0.3, rah_external_output-1.1.0, geo_vote-0.1.4m, smd_lib-0.36, soo_plugin_pref-0.2.2, soo_txp_obj-1.1.0
(not all Plugins i need – i have tried many ways for images… and zem contact reborn is not work in the new website. dtj_obfuscated_email too.)

Edit: in the Diagnose I found a little bit difference:
new website:

#php_value register_globals 0
<IfModule mod_mime.c>
    AddType image/svg+xml  svg svgz
    AddEncoding gzip       svgz
</IfModule>
# END Textpattern
------------------------
Charset (default/config): latin1/utf8mb4
character_set_client: utf8mb4
character_set_connection: utf8mb4
character_set_database: utf8
character_set_filesystem: binary
character_set_results: utf8mb4
character_set_server: latin1
character_set_system: utf8
character_sets_dir: /usr/share/charsets/
17 Tables: OK

old Website:

#php_value register_globals 0
------------------------
Charset (default/config): latin1/utf8
character_set_client: utf8
character_set_connection: utf8
character_set_database: latin1
character_set_results: utf8
character_set_server: latin1
character_set_system: utf8
character_sets_dir: /usr/share/mysql/charsets/
17 Tables: OK

Last edited by lythande (2018-03-09 08:00:58)

Offline

#26 2018-03-09 13:28:01

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: geo_vote

Hm. You could try a brand new installation, install geo_vote there as the only plugin, and ex-/import that installation’s geo_vote table(s?) into your existing 4.6.2 instance.

But I just tried installing the plugin on the 4.7.0beta and there wasn’t even an extension tab to visit (the plugin was active and I tried it from another tab than Plugins, i.e. the menu should have been visible.). So chances are you can’t update your 4.6.2 later on, once 4.7.0 stable becomes available.

I can’t tell whether Claire/cebe’s cbe_helpful would do what you need, but maybe it causes you less hassle to find that out than the steps I outlined above.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#27 2018-03-10 13:10:25

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: geo_vote

lythande, also have a look at yab_review_rating. The topic came up today, totally forgot about that plugin.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#28 2018-03-20 11:15:47

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: geo_vote

Much thanks Uli,
sorry for the long rest.
I have look around the other plugins, but there are not a survey, only to rating somethings e.g. an article.
So I have try at first your idea to make an clear Install of Textpattern and tried to install the geo_vote-Plugin. But same error as before. So then I exporting the tables from the working Textpattern and importing it to the new Textpattern-Tables in MySQL (and before I importing set the txpprefix).
Then does work in the new Textpattern. :-)

So I have tried it to expanse with a subtitle (because I need it) and have solution it too. :-)
(I insert a “vote_subtitle” inside the plugin-php and set a new table-line in the Table “geo_vote_meta”.)

And then I using the title-class to set an title for the vote_title, but in the first time this doesnt works. But I found an error in the original-plugin and changing it (see below).

On the Line function geo_vote_show_ballot($rs, $message){

$out[] = '<div class= "$vote_title_class"><h2>'.doSpecial($vote_title).'</h2></div>'; 

—> doesn’t set a class!

it should be:

$out[] = '<div class= "'.$vote_title_class.'"><h2>'.doSpecial($vote_title).'</h2></div>'; 

—> then would be set a class (which set in the form)

is only need a '. .' outside the $vote_title_class.

Separated text from code to make it easier to compare the two versions. —Uli

Last edited by uli (2018-03-20 11:33:49)

Offline

#29 2018-03-20 11:32:44

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: geo_vote

Great that you could make everything work, congratulations!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#30 2018-03-20 11:38:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: geo_vote

Long shot: installation success probably depends on your version of PHP. If it’s 7+ then the plugin will spectacularly fail to install. Band-aid using mysqli_* function calls:

function geo_vote_install($message) {
	global $DB;
	$version = mysqli_get_server_info($DB->link);
	$GLOBALS['txp_err_count'] = 0;
	if ($version < "4.1.2") {
		$GLOBALS['txp_err_count']++;
		trigger_error("geo_vote requires MySQL v4.1.2 or greater.");
	} else {
		$ret = '';
		$sql = array();
		$sql[] = "CREATE TABLE IF NOT EXISTS `".PFX.GEO_VOTE_CHEAT."` (
						`pk` int(4) NOT NULL auto_increment PRIMARY KEY,
			`vote_id` int(4) NOT NULL default 0,
			`option` int(4) NOT NULL default 0,
			`cookie_ip_login` varchar(64) NULL default '',
			INDEX (vote_id)
						) ENGINE=MyISAM PACK_KEYS=1 AUTO_INCREMENT=1";

		$sql[] = "CREATE TABLE IF NOT EXISTS `".PFX.GEO_VOTE_FORM."` (
			`hash_key` varchar(32) NOT NULL PRIMARY KEY,
			`t_stamp` TIMESTAMP NOT NULL default CURRENT_TIMESTAMP
						) ENGINE=MyISAM PACK_KEYS=1";

		$sql[] = "CREATE TABLE IF NOT EXISTS `".PFX.GEO_VOTE_META."` (
			`vote_id` int(4) NOT NULL auto_increment PRIMARY KEY,
			`vote_title` varchar(64) NULL default '',
			`option_title_1` varchar(64) NULL default '',
			`option_title_2` varchar(64) NULL default '',
			`option_title_3` varchar(64) NULL default '',
			`option_title_4` varchar(64) NULL default '',
			`option_title_5` varchar(64) NULL default '',
			`option_title_6` varchar(64) NULL default '',
			`option_title_7` varchar(64) NULL default '',
			`option_title_8` varchar(64) NULL default '',
			`option_title_9` varchar(64) NULL default '',
			`option_title_10` varchar(64) NULL default '',
			`option_1` int(4) NOT NULL default 0,
			`option_2` int(4) NOT NULL default 0,
			`option_3` int(4) NOT NULL default 0,
			`option_4` int(4) NOT NULL default 0,
			`option_5` int(4) NOT NULL default 0,
			`option_6` int(4) NOT NULL default 0,
			`option_7` int(4) NOT NULL default 0,
			`option_8` int(4) NOT NULL default 0,
			`option_9` int(4) NOT NULL default 0,
			`option_10` int(4) NOT NULL default 0,
			`total_votes` int(4) NOT NULL default 0,
			`show_results` varchar(3) NOT NULL default '',
			`cheat_method` varchar(6) NOT NULL default '',
			`end_date_time` DATETIME NOT NULL default '0000-00-00 00:00:00',
			`vote_bar_colour` varchar(32) NOT NULL default '',
			`vote_title_class` varchar(64) NOT NULL default '',
			`option_title_class` varchar(64) NOT NULL default '',
			`end_date_time_class` varchar(64) NOT NULL default '',
			`vote_button_class` varchar(64) NOT NULL default ''
							) ENGINE=MyISAM PACK_KEYS=1 AUTO_INCREMENT=1";

		if(gps('debug')) {
			dmp($sql);
		}

		foreach ($sql as $qry) {
			$ret = safe_query($qry);
			if ($ret===false) {
				$GLOBALS['txp_err_count']++;
				echo "<b>".$GLOBALS['txp_err_count'].".</b> ".mysqli_error($DB->link)."<br />\n";
				echo "<!--\n $qry \n-->\n";
			}
		}
	}

	if ($GLOBALS['txp_err_count'] == 0) {
		$message = geo_vote_gTxt('tbl_installed');
		geo_vote_config($message);
	} else {
		$message = geo_vote_gTxt('tbl_not_installed');
		geo_vote_config($message);
	}
}

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#31 2018-03-20 12:32:41

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: geo_vote

Thx Bloke for the Idea to look in my php-Version. My php-Version is “5.6.19” –
If I you correct understand, can this plugin only installing on php-version maximum “4.1.2”? Or should it install, because my php-Version is bigger than “4.1.2.”?

How (and where) can set the Plugin for newer php-Versions? Or have I you don’t understand…? (my english is not the best, sorry…)

Offline

#32 2018-03-20 12:50:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: geo_vote

lythande wrote #310157:

My php-Version is “5.6.19”

Okay, then your installation woes are unlikely to be caused by the plugin’s use of mysql_* functions. Not sure why it wouldn’t install. When I treid, it did take a few enable/disable cycles before I saw the Vote tab on the menu. No idea why.

can this plugin only installing on php-version maximum “4.1.2”?

Nope, that value refers to the minimum supported MySQL version.

The patch I made just fixes the use of mysqli_* (with an ‘i’) calls so anyone running newer versions of PHP can play.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#33 2018-03-20 13:02:37

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: geo_vote

Okay, I try out your patch in my one textpatter-plugin.

Edit:
Many many thanks, your Patch works great!!! :-)

I have set my new Lines for vote_subtitles inside the Plugin-PHP and your patch too. Then I go to “Expanses” – “Vote” and there is very quick to install the Tables and was finish in 2 seconds. With my “vote_subtitles”! :-)

Edit 2:
wowww, I have look in my php-database and there is now the right collation utf8_general_ci! Much thanks for that too!!!

Last edited by lythande (2018-03-20 13:24:21)

Offline

#34 2019-01-19 18:08:20

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: geo_vote

Hi,
now I wish to using the vote-plugin. But each of the option-bars of a question has the same color (Option 1, Option 2 …).
How I can make the class for the option-bar do different for each bar?

Under "function geo_vote_show_results($rs, $message){ :

if (${‘option_title_’.$i} != ‘’) { … //hard coded css for alpha release $out[] = ‘<div class=”’.$option_title_class.’” style=“width:’.$total_votes_percent[$i].’%;height:16px;”></div>’;

doesn’t work it with:

$out[]= ‘<div class=”’.$option_title_class-$1.’”…>

its outputting in the source without '<div class="'.$option_title_class-$1.'"> and only -1"> and then the follow code doesnt work. Its erased <div class="'.$option_title_class.

Has someone an idea how I can make it for this final:

<span class=“option_title_class”>Ja (100%, 4 Teilnahme)</span><br /><div class=“option_title_class-1” style=“width:100%;height:16px;”>(bar is green)</div>

so e.g. for the bars:

<div class=“option_title_class-1” >(the bar is green with class)</div>
<div class=“option_title_class-2” >(the bar is red with class)</div>
<div class=“option_title_class-3” >(the bar is grey with class)</div>

Last edited by lythande (2019-01-19 18:09:56)

Offline

#35 2019-01-19 20:10:08

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: geo_vote

A second question:

in the vote_title-field I wish to use the questionmarks "title". But it outputting with \"title\"
How I can use the "title" without the backslash \?

Offline

#36 2019-02-25 22:44:42

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: geo_vote

Hmm, nobody has an idea to help me?

Offline

Board footer

Powered by FluxBB