idaryl 15 Newbie Poster

I did upgrade using the button - I did contact MAMP support - The upgrade created a copy of the orig ( this is what I was using )

However, it created a 5.6 version and not a 5.7

So I did follow all the steps.....

And I did upgrade the DB as was told to from the beginning...

idaryl 15 Newbie Poster

Mine shows 5.6

Do I need to upgrade again

Now I wonder if I have corrupted them too much

idaryl 15 Newbie Poster

This is the content of that file

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */

/**
 * Holds the PMA\TableChartController
 *
 * @package PMA
 */

namespace PMA\libraries\controllers\table;

use PMA\libraries\controllers\TableController;
use PMA\libraries\Message;
use PMA\libraries\Response;
use PMA\libraries\Template;
use PMA\libraries\Util;

/**
 * Handles table related logic
 *
 * @package PhpMyAdmin
 */
class TableChartController extends TableController
{

    /**
     * @var string $sql_query
     */
    protected $sql_query;

    /**
     * @var string $url_query
     */
    protected $url_query;

    /**
     * @var array $cfg
     */
    protected $cfg;

    /**
     * Constructor
     *
     * @param string $sql_query Query
     * @param string $url_query Query URL
     * @param array  $cfg       Configuration
     */
    public function __construct($sql_query, $url_query, $cfg)
    {
        parent::__construct();

        $this->sql_query = $sql_query;
        $this->url_query = $url_query;
        $this->cfg = $cfg;
    }

    /**
     * Execute the query and return the result
     *
     * @return void
     */
    public function indexAction()
    {
        $response = Response::getInstance();
        if ($response->isAjax()
            && isset($_REQUEST['pos'])
            && isset($_REQUEST['session_max_rows'])
        ) {
            $this->ajaxAction();
            return;
        }

        // Throw error if no sql query is set
        if (!isset($this->sql_query) || $this->sql_query == '') {
            $this->response->setRequestStatus(false);
            $this->response->addHTML(
                Message::error(__('No SQL query was set to fetch data.'))
            );
            return;
        }

        $this->response->getHeader()->getScripts()->addFiles(
            array(
                'chart.js',
                'tbl_chart.js',
                'jqplot/jquery.jqplot.js',
                'jqplot/plugins/jqplot.barRenderer.js',
                'jqplot/plugins/jqplot.canvasAxisLabelRenderer.js',
                'jqplot/plugins/jqplot.canvasTextRenderer.js',
                'jqplot/plugins/jqplot.categoryAxisRenderer.js',
                'jqplot/plugins/jqplot.dateAxisRenderer.js',
                'jqplot/plugins/jqplot.pointLabels.js',
                'jqplot/plugins/jqplot.pieRenderer.js',
                'jqplot/plugins/jqplot.highlighter.js'
            )
        );

        /**
         * Extract values for common work
         * @todo Extract common files
         */
        $db = &$this->db;
        $table = &$this->table;
        $url_params = array();

        /**
         * Runs common work
         */
        if (strlen($this->table) > 0) {
            $url_params['goto'] = Util::getScriptNameForOption(
                $this->cfg['DefaultTabTable'], 'table'
            );
            $url_params['back'] = 'tbl_sql.php';
            include 'libraries/tbl_common.inc.php';
            include 'libraries/tbl_info.inc.php';
        } elseif (strlen($this->db) > 0) {
            $url_params['goto'] = Util::getScriptNameForOption(
                $this->cfg['DefaultTabDatabase'], 'database'
            ); …
idaryl 15 Newbie Poster

I use MampPro to setup my sites on the local server... all well and good. So, every time I fire it up I get the upgrade nag... so, I figure its time, and hit the upgrade... and it does its thing.

BOOM, every database I had there - gone! GRR! Dang! - Fortunately I was proactive and copied all of the previously ( the DB dir Mamp ). The internet tells me to simply put them back in the dir and restart - which I do....

Now PhpMyAdmin "sees" the DB's but does not have index's for any of them - I can see the column structure, but they have this yellow/red error for anything I try to open.

Here's an image of what its doing -- https://i.stack.imgur.com/xi3yM.png
Click Here

Does anyone know how to repair this - all my work is gone... I mean literally, everything!

Maybe there's some form of sql insert that will look at the columns and add the table index - I don't know SQL is not my baliwyck

idaryl 15 Newbie Poster

Firstly a little overview - my site uses Wordfence (this is not the issue - just the reason for this to begin with)

-- Even if Wordfence is disabled this should still work. its just what brought this to light.

And... I have been getting numerous login attempts from different places and IP's using the hidden password recovery, or simply force loading names into the admin page.

I have seen a pattern emerging, whereas the popular name tries are: administrator, wpadmin, admin, wpadministrator, and a few others. Sometimes in the range of 150+ an hour, quite amazing, and annoying at the same time.

Wordfence does an abmirable job of blocking the attempts, however, I've noticed the same naming structure is applied repeatedly. And...Wordfence does its job, blocks the attempt, and themn proceeds to notify me about it - this has led to an inordinate amount of the exact same mail with the exact same login pattern.

Whew....!

So I figured I would add some kind of filtering to the login page by adding this ( part of the larger project - but its where it hanging up ) Not hanging up really, just only recognizes ONE name structure.....

public static function gtfo_admin_login( $login = '' ) {
    if ( 'administrator' != $login ) {
        return false;
    }

    wp_redirect( 'http://www.french-bukkake.com' ); // This is an example.
    exit;
}

So if some uses the name administrator, it forwards them to the (sorry-france) xxxx.page

I would like this to use some kind of …

rproffitt commented: Brill. GTFO...! +15
idaryl 15 Newbie Poster

I am trying to get a small plugin Im putting together to work from the admin page - I have the functrion working, although it would be better to "activate" it from that page *the default would be "OFF"

here is a copy of the function - it just turns off the lost password text and function in Wordpress

class LostPasswordPage
{
    /* Holds the values to be used in the fields callbacks */
    private $options;

    /* Start up */
    public function __construct()
    {
        add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
        add_action( 'admin_init', array( $this, 'page_init' ) );
    }

    /** Add options page */
    public function add_plugin_page()
    {

    /* This page will be under "Settings" */
    add_menu_page(
            'Settings Admin', 
            'Lost Password', 
            'manage_options', 
            'lost-pwd-setting-admin', 
            array( $this, 'create_admin_page' )
        );
    }

    /* Options page callback */
    public function create_admin_page()
    {
        // Set class property
        $this->options = get_option( 'lost_pwd_option_onoff' );
        ?>
        <div class="wrap">
            <h1 style="margin-bottom:-10px;">Small Additional Security Function</h1>
            <span style="display:block;max-width:370px;text-align:right;"><sub>1.0.0a Robab Tools</sub></span>
            <form method="post" action="options.php">
            <?php
                // This prints out all hidden setting fields
                settings_fields( 'lost_pwd_option_group' );
                do_settings_sections( 'lost-pwd-setting-admin' );
                submit_button();
            ?>
            </form>
        </div>
        <?php
    }

    /* Register and add settings */
    public function page_init()
    {        
        register_setting(
            'lost_pwd_option_group', // Option group
            'lost_pwd_option_onoff', // Option name
            array( $this, 'sanitize' ) // Sanitize
        );

        add_settings_section(
            'setting_section_id', // ID
            'DisableLost Password Form and Label', // lostpwd
            array( $this, 'print_section_info' ), // Callback
            'lost-pwd-setting-admin' // Page
        );  

        add_settings_field(
            'lostpwd', 
            'Disable Lost Password? &rarr;', 
            array( $this, 'lostpwd_callback' ), 
            'lost-pwd-setting-admin', 
            'setting_section_id'
        );      
    }

    /**
     * Sanitize each setting field …
idaryl 15 Newbie Poster

Well here's an update!

  • added a css white-space: pre; /* or pre-wrap */class to the tabs

and the "/n" worked....

idaryl 15 Newbie Poster

Thanks for the input but that didn't work... it just displayed the html as a string (like) <br>

idaryl 15 Newbie Poster

I have this function (woocommerce) and it changes the product descriptions tab titles from the defaukt....

add_filter( 'woocommerce_product_tabs', 'wc_change_product_description_tab_title', 10, 1 );
function wc_change_product_description_tab_title( $tabs ) {
  global $post;
    if ( isset( $tabs['description']['title'] ) )
    $tabs['description']['title'] = '★ Product Information'."\n".' ★ Ingredients'."\n".' ★ Sizes';
    return $tabs;
}

The problem is, that it does not separate new titlles like this:

★ Product Information
★ Ingredients
★ Sizes

I've tried \n and \r and <br> and char(13) to get them to stack......
But Im running into a dead-end. Is there a way to do this other than ( ."\n". ) ? and even that does not work :(

idaryl 15 Newbie Poster

I guess this is of no interest anymore.... :(

idaryl 15 Newbie Poster

I tried this

document.getElementById('showQuote').addEventListener('click', function(){ document.write(getQuote()); });

but it rewrites the page by replacing the form inputs with the results.....

also a checkbox (id sided) with a value of a 1,00 does not add to the var total using +sided... still working on it though

idaryl 15 Newbie Poster

I have been watchingt as well, but I never know when someone enters anything (Im not notified) so I just look at this page on an ongoing infrequent way.... sorry, :(

Your fiddle creates an alert that if the user changes their mind the alert prompts you to prevent the page from creating more alerts, this would defeat the process, however you have shortened my long code down to a way smaller chunk and I am experimenting with adding a radio and a checkbox sampling to see if I can incorporate them. Following the methodology of your sample I may be able to copy/past additional amount to add to the final [ var total = sizePrice copies * pages; ]

I am also trying to get the result to echo under the input fields.....

Thanks so much for the input......

idaryl 15 Newbie Poster

That complicating it more - although I asked the client anyway and they say no - thanks for the interest and input.

idaryl 15 Newbie Poster

Yes you are right, the price could be in an array (here's some thinking)
The selection could be based on an option drop so if the user selects, letter, then the price would be 5¢, or selects legal then its 7ç etc, etc

Then in the array the price could be changed at will - ***the price (depending on choice) will apply to the copies as well

<select name="pagestype">
    <option value="letter">Letter</option>
    <option value="legal">Legal</option>
    <option value="tabloid">Tabloid</option>
    <option value="poster">Poster</option>
  </select>
idaryl 15 Newbie Poster

Yes.....

but if I change the price (0.05) in the functions, then it should apply also.

for example: the owner may decide to change it from 5¢ to 7¢ or whatever - if the price is in a var then it could be changed at any time according to the clients needs.

idaryl 15 Newbie Poster

I have this form I've cobbled together from found sources and experimenting - its a page count copy calculator. Each page is worth 5¢, and the user enters the amount of pages to copy (first field) and the amount of copies needed (2nd field) *this may also need to be a separate price - something like padding the default price by a few cents each.

On submit, the page count value is multiplied by the pagecopy field value. A result message is displayed.

What I'm out of my league on is; if the pages have a set price of .5¢ (I assume that would be a var) can the page count price also be multiplied by the page copy to display the total page count price amount? EG:

A page count of 23. Multiplied by 4 copies,
is a total page count of 92 pages...
Price is $xx.xx

To make matters more interesting the client has added a variable where the "size" of the paper would effect the cost.

My code is here.........

<script>
function solve() {
 var pageprice_opt = document.getElementsByName("pageprice");
                var page_count = document.getElementById("pgct").value;
                var copy_amt = document.getElementById("cpypg").value;

                if (page_count=="") {

                var msg = "<span class='warning'>How many pages?</span>";
                    document.getElementById('msg').innerHTML = msg;
                    return false;
                } 
             else if (copy_amt=="") {
                 var msg = "<span class='warning'>How many copies?</span>";
                    document.getElementById('msg').innerHTML = msg;
                    return false;
                    }

            if (pageprice_opt[0].checked == true) 
                product = parseInt(page_count) *parseInt(copy_amt);     
                results = "<span class='message'>A page count of " 
                    + page_count + ". Multiplied by " + copy_amt + …
idaryl 15 Newbie Poster

Hello all,

of late I have been using this php snippet to drive the email address of a link

info@<?php echo preg_replace('/^www./','',$_SERVER["HTTP_HOST"]); ?>

But now Im finding that if its used in a https (secure environment) I get an security messgae saying: The information you have entered on this page will be sent over an insecure connection and could be read by a third party. Are you sure you want to send this information?

what do I need to change the code to reflect the https variable so it does not throw the error, especially sibce it in a secure https location.

would there be a differenc if it were $_SERVER["HTTPS_HOST"] ?

TIA

idaryl 15 Newbie Poster

What is happenening is, the area for the price has a background color and padding set to it - but... when there is no price applied the field still shows on the page as a small rectangle of the background color.

All I desired to to do was hide it if there is no input (PRICE) entered by the admin, thats all. I tried some functions I found but they didnt work.

idaryl 15 Newbie Poster

Oh my... had no idea about the CSS empty attribute, worked great..... Added it to the arsenal, thank you! :0 :)

idaryl 15 Newbie Poster

I have a restaurant menu theme and there are some menu items the owner has, with no pricing (all menu items have the option for a price and an alternate price)

In the taxonomy-menutype.php file [ shows the menu items ] there is this:

<div class="pricebox">
                        <?php if ( get_post_meta($post->ID,'atp_price',TRUE) ) {
                            echo'<span class="price">'.get_post_meta($post->ID,'atp_price',TRUE).'</span>';
                        } ?>

                        <?php 
                        $moreprices = get_post_meta(get_the_id(),'atp_moreprice',true);
                        if( is_array( $moreprices ) ){ ?>
                            <?php foreach( $moreprices as $itemprice ) {?>
                                <span class="price"><?php echo $itemprice; ?></span>
                            <?php } ?>
                        <?php } ?>
                        </div>

What I need to do is hide the (either) field if there is no input (empty) otherwise if there is, then show the field...

idaryl 15 Newbie Poster

Up until 5 days ago Outlook 2011 on my iMac was working fine -but now it recieves emails but I cannot send them - all it does is save them as drafts.

I have it setup so it receives and sends from my (imap) gmail account (as I said it was fine until a few days ago). *I changed nothing - no reason to.

So searching the web produced a lot of "change the settings to this or that" but none of those remedies worked.

Has this happened to anyone, is there a fix for this? or does anyone know how to get Outlook running again - I use it for my business

idaryl 15 Newbie Poster

The array looks like this:

array(
            'type' => 'custom_radio',
            'heading' => __( 'First set of radios', 'rb_radio_tz' ),
            'param_name' => 'custom_radio3',
            'std' => '',
            // default unchecked - add radio name to set as checked
            'value' => array(
                __( 'Movie', 'rb_radio_tz' ) => 'Movie',
                __( 'DVD', 'rb_radio_tz' ) => 'DVD',
                __( 'Live Show', 'rb_radio_tz' ) => 'Live Show',
                __( 'Broadway', 'rb_radio_tz' ) => 'Broadway',
            ),
            'save_always' => true,
            'description' => 'Radio set one description',
              'group' => __( 'Radio Four', 'rb_radio_tz' )
        ),

If I try to add it like this: __( 'Live Show', 'rb_radio_tz' ) => '<i class=fa fa-eye></i> Live Show', it completely breaks the page... bummer

idaryl 15 Newbie Poster

The only way I can get an icon to show, is to put it in the heredoc output - because if I try it in the array it breaks.

Probably becaue of the <> operators or the / that is associated with the string - could they be escaped in the array?

idaryl 15 Newbie Poster

I am using this output from a radio array in a heredoc output

{$custom_radio2_2}

and wanted to add a font awseome icon to the variable output like <i class=fa fa-eye></i> - however if I just use it in the heredoc its always present...and I just want it to appear whenver that radio choice is made - (I have other icons for the other choices and they should also swap if a different choice is made.

The idea is not to have any icons showing if a choice is not made, but if one is, then the icon for that choice will show with the variable data

Am I making any sense, I tried adding different types of strings inside the brakets/braces? but all it does is dispaly onscreen (not good) how would I go about getting specific icons to show depending on the radio chosen?

idaryl 15 Newbie Poster

its not in a child theme - I never said it was.... Yes... that was my fault - the assumption was that I was talking abourt a child theme, no.

I have a plugin I'm developing for another plugin call Visual Composer - (it uses its own set of css to style results from the user entry) the naming convention for those css rules does not conflict with the WP css.

However, as I mentioned its working, but with a limnitation, only on the home page or internal pages, and Ive narrowed it down to the hardcoded path of the css (either ../wp-content or... just wp-content)

I tried the standard wp plugin path ( plugin_dir_path( $file ) ) but thats ignored. So I wanted to get a function into the file to call to the path but that didnt work - but in an array (referencing some text - with the twoo different paths - it does work) provided I add it as a var like $bgd_path.

Now I have a radio system asking if its on the homepage or not. Much rather prefer it to be automatic and completely invisible to the user.

idaryl 15 Newbie Poster

I added a feature to the plugin that asks the user whehter or not its being used on the home page or any other - once selected, it applies the ../wp-content or wp-content into the path via an array result {$bgd_place}

Until I figure a different method where it automagically just is aware of the plugin dir, this will do - kludgy at best - but its a fix for the moment - thanks

idaryl 15 Newbie Poster

This is from a plugin I have developed - if, as I said it does not display on the homepage using ../wp-content - but on the other pages does.

And then if I change it to wp-content (no dots etc) it shows on the homepage only - this has nothing to do with the placement of child themes or templates therein.

idaryl 15 Newbie Poster

Hello,
in a style css I have a reference to a horizontal rule background image:

background: url(../wp-content/plugins/hrticulate/assets/hrs/hr-bluetooth-saw.png) repeat-x 0 0;

no matter what theme I turn on (even the default WP themes) it will not display on the home page - however, it will display on any post/page/category or whatever [inside] the theme. I can place it anywhere and it will display..... but not on the homepage [any homepage, regardless]

any ideas on this... its got me bamboozled... :(

or is there a way to get it to look into the plugins dir - like a path of some kind?