Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter dsonesuk

    (@dsonesuk)

    AAAAAAAAAARRRRRRRRGGGGGGHHHHHHHHHH caught out Again! by this stupid exclude, what do you expect from a stupid CMS… well its not! a CMS it is A BLOG system, attempting to be CMS and failing miserably, useless category system, that produces incorrect urls, ALL I DO is HACK, HACK HACK to make it resemble a competent CMS which WordPress will never ever be! I can understand why there are lots of WordPress developers, IT IS a full time job, continuously correcting EVERYTHING, over and over, and charging a small fortune. Monty python ‘spam, spam,spam’ WordPress ‘hack, hack, hack, hack’

    Thread Starter dsonesuk

    (@dsonesuk)

    Finally had time to produce it

    function customize_dropdown($html, $type, $metakey, $compare, $metaval, $label, $all, $i, $defaultclass, $id, $divclass) {
    
        if ($metakey === "project_month_and_year") {
    
            $optionlist = new date_list();
            $MonthYearopts = $optionlist->showDateList();
    
            $opts = explode("|", $MonthYearopts);
    
            $html = '<div class="' . $defaultclass . ' ' . $divclass . '" id="cmf-select' . $i . '"><span class="cmflabel-' . $i . '">' . $label . '</span>';
            $html .= '<input type="hidden" name="cmf[' . $i . '][metakey]" value="' . $metakey . '">';
            $html .= '<input type="hidden" name="cmf[' . $i . '][compare]" value="' . $compare . '">';
            $html .= '<select id="cmfdp-' . $i . '" class="cmfdp-class-' . $i . '" name="cmf[' . $i . '][value]">';
            if (!empty($all)) {
                $html .= '<option value="uwpqsfcmfall">' . $all . '</option>';
            }
    
            foreach ($opts as $opt) {
                $val = explode('::', $opt);
                $selected = (isset($_GET['cmf'][$i]['value']) && $_GET['cmf'][$i]['value'] == $val[0]) ? 'selected="selected"' : '';
                $html .= '<option value="' . $val[0] . '" ' . $selected . '>' . $val[1] . '</option>';
            }
            $html .= '</select>';
            $html .= '</div>';
        }
        return $html;
    }
    
    add_filter('uwpqsf_cmf_field_dropdown', 'customize_dropdown', '', 12);
    
    class date_list {
    
        public $dateStart = "first day of this Month 00:00";
        public $dateIncrement = "+ 1 Month";
        public $dateEnd = " + 15 Months";
        public $dateFormat = 'F Y';
    
        public function showDateList() {
            $StartPeriod = new DateTime(date($this->dateFormat, strtotime($this->dateStart)));
            $LastPeriodRange = clone $StartPeriod;
            $LastPeriodRange->modify($this->dateEnd)->format($this->dateFormat);
    
            $Months = $StartPeriod;
            $join = "";
    
            while ($Months->getTimestamp() < $LastPeriodRange->getTimestamp()) {
    
                $join.=$Months->format($this->dateFormat) . "::" . $Months->format($this->dateFormat) . "|";
    
                $Months->modify($this->dateIncrement)->getTimestamp();
            }
            $join = trim($join, "| ");
            return $join;
        }
    
    }

    Thread Starter dsonesuk

    (@dsonesuk)

    P.S I’ve managered to use simple PHP replace on these on form creation code. it works, but! bit of hack. Prefer option to set values at dashboard plugin backend though, seems obvious requirement.

    Thread Starter dsonesuk

    (@dsonesuk)

    “Issue seems to be this item floating in the middle
    $exclude_ids = [19];”

    No syntax error shows from current example used? from editor used or from php display errors settings, so I don’t currently see why you have syntax error showing?

    Thread Starter dsonesuk

    (@dsonesuk)

    And how exactly? do I trigger it overwrite/ride current values into that dropdown? do i insert a specific option text value so it will cause it to specifically add dynamic month year code when trigger code is discovered. I also presume I do not want to edit the core file link to, so I need to know how to apply my code over current core file code for this drop down only. I mean if I could link to php file, or add code directly into where drop down values and text are entered, this would not be a problem, but! I need a way to target and apply my code while maintaining the same functionality of the plugin, without having to rewrite it after every update.

    Thread Starter dsonesuk

    (@dsonesuk)

    Well looking at the form itself and specific dropdown it says metakey as in name=”cmf[1][metakey] so I take it as being metakey, 1 of the two other dropdown says [taxo][term]

    I was just asked to update it manually? By filling these months and years for the dropdown, which seem bit of a silly way to do it to me, as I have done similar before with PHP.

    I have a feeling it does not matter about the year just months, the year is just for show at the moment, because same content appears for May 2015 and May 2016, but it would be more practical to set it up dynamically, as at the moment it only gets updated, if and when he remembers too, and can get someone to do it for him, as its beyond him at this present time.

    Thread Starter dsonesuk

    (@dsonesuk)

    Now that more like It! Thanks, I knew previous coding was class access, the coding example, I’m sure I tried that? but never mind, it works now, excellent.

    add_action('bcn_after_fill', 'exclude_these_crumbs');
    
    $exclude_ids = [1,126];
    
    function exclude_these_crumbs($trail) {
        global $exclude_ids;
    
        foreach ($trail->breadcrumbs as $key => $breadcrumb) {
            if (in_array($breadcrumb->get_id(), $exclude_ids)) {
                array_splice($trail->breadcrumbs, $key, 1);
            }
        }
    }
    Thread Starter dsonesuk

    (@dsonesuk)

    $trail
    add_action(‘bcn_after_fill’, ‘foo_pop’);

    function foo_pop($trail) {

    }

    which gives bcn_breadcrumb_trail, works! with var_dump() it shows me all the the info i wish to access, it shows all titles, id as protected or private, I can’t loop through to compare values i wish to use to identify the breadcrumb i wish to remove, WHY? because they are protected or private.

    bcn_breadcrumb::get_title()
    bcn_breadcrumb::get_id()

    Do nothing but throw up error, if you had bothered to supply example in what context these are supposed to be used, this would not have happened, so I guessed, most likely wrongly, and here we are again.

    Thank again for any useful help

    if you replace:

    var flashVars = {xmlfile: ‘<?php echo $show->guid, (‘.xml’); ?>’}

    with:

    var flashVars = {xmlfile: ‘<?php echo “https://&#8221;.$_SERVER[‘HTTP_HOST’]?>/wp-content/uploads/flShow_carousel_<?php echo $flshow_id.”.xml”;?>’ };

    it should find the uploads directory where your xml file is placed, and the id ref (flShow_carousel_XXX, where XXX equals id ref) and add xml extension.

Viewing 9 replies - 1 through 9 (of 9 total)