WordPress.org

Ready to get started?Download WordPress

Forums

Pierre's Wordspew
fixes to archive page (3 posts)

  1. kruvas
    Member
    Posted 3 years ago #

    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)
    http://hotfile.com/dl/88597633/bf0122e/lang_rus.zip.htm

    hope it helped somebody

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

  2. Pierre_02
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  3. kruvas
    Member
    Posted 3 years ago #

    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 )
    http://f12010news.mine.nu/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic