• hi, i fix some mistake and old code in archive
    wordspew_archive.php

    1st – config load
    from

    require_once('../../../wp-config.php');
    include_once ('common.php');
    
    if (!isset($table_prefix)) {
    	$html = implode('', file("../../../wp-config.php"));
    	$html = str_replace ("require_once", "// ", $html);
    	$html = str_replace ("<?php", "", $html);
    	eval($html);
    }

    to

    require('../../../wp-load.php');
    include_once ('common.php');

    2nd not working pagination (show only 1st page of archive)
    it happened because not work code for get archive lenght (table rows)
    original

    $wpdb->hide_errors();
    	$SQL="SELECT SQL_CALC_FOUND_ROWS id, time, name, text, url, ipaddr, email FROM ".$_SESSION['tb_prefix']."liveshoutboxarchive ";
    	$SQL.="WHERE cat='".mysql_real_escape_string($cat)."' ORDER BY id DESC LIMIT ".$offset.",".$limit;
    	$results = $wpdb->get_results($SQL);
    	$wpdb->show_errors();
    
    	$result	= mysql_query('SELECT FOUND_ROWS() AS total');
    	$data	= mysql_fetch_assoc($result);
    	$total=$data['total'];

    fixed

    $wpdb->hide_errors();
    	$SQL="SELECT SQL_CALC_FOUND_ROWS id, time, name, text, url, ipaddr, email FROM ".$_SESSION['tb_prefix']."liveshoutboxarchive ";
    	$SQL.="WHERE cat='".mysql_real_escape_string($cat)."' ORDER BY id DESC LIMIT ".$offset.",".$limit;
    	$results = $wpdb->get_results($SQL);
    	$data = $wpdb->get_results('SELECT FOUND_ROWS() AS total');
    	$wpdb->show_errors();
    	$total=$data[0]->total;

    also i made translation in russian for 10-20 messages (and two corrected)
    https://hotfile.com/dl/88597633/bf0122e/lang_rus.zip.htm

    hope it helped somebody

    and thank for your work, Pierre Sudarovich. great chat anyway.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pierre_02

    (@pierre_02)

    Hi kruvas,

    i’m sorry i’ve never heard that some of you have problems with that page :$… So thank you for the trick for users with that problem ;).
    Thanks too for the Russian translation ; but may i abuse, and ask you if you can finalize the translation… ?? ?

    TIA,

    Amicably,

    Pierre.

    Thread Starter kruvas

    (@kruvas)

    ok, I’ll try to update the translation.

    also i fix some problem with init (maybe old wp config load style? – i think not need support very old, buggy versions)

    also i fixed very specific hosting “bug” related to chat.
    it add \r\n symbol to reply when ajax message send to server (maybe free hosting ads adder script do this)
    i fix it by edit js script function handlehHttpReceiveChat
    orig:

    function handlehHttpReceiveChat() {
    	if (httpReceiveChat.readyState == 4) {
    		firstarray = httpReceiveChat.responseText.split('\n');
    		if (firstarray.length == 2) { // if != 2, it failed, we should skip the processing part

    my:

    function handlehHttpReceiveChat() {
    	if (httpReceiveChat.readyState == 4) {
    		firstarray = httpReceiveChat.responseText.split('\n');
    		if (firstarray.length == 3 && firstarray[2]=='') { // if == 3, check for extra \n added to end of string and remove it
    			firstarray.splice (2,1);
    		}
    		if (firstarray.length == 2) { // if != 2, it failed, we should skip the processing part

    maybe switch to more bulletproof format? like json-style or direct use json

    here my hosting to check my words )
    https://f12010news.mine.nu/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Pierre's Wordspew] fixes to archive page’ is closed to new replies.