• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeExtinguisher 2.0 Release Candidate 14.2

#91
[eluser]daulex[/eluser]
this is what comes back if Date_eu is included.
Code:
Parse error: syntax error, unexpected ';', expecting T_PAAMAYIM_NEKUDOTAYIM in D:\xampp\htdocs\ce\system\application\backend\plugins\date_eu.php on line 26

#92
[eluser]Majd Taby[/eluser]
make sure there's no semi colon on this line: $CI = &get;_instance(); The semi colon you see after get is added by the forums and causes a lot of confusion

#93
[eluser]daulex[/eluser]
[quote author="jTaby" date="1212126325"]make sure there's no semi colon on this line: $CI = &get;_instance(); The semi colon you see after get is added by the forums and causes a lot of confusion[/quote]

line 26
Code:
$CI = &get;_instance();

and 24-28 just in case
Code:
function getHTML()
    {
        $CI = &get;_instance();
        $CI->codextemplates->css_assets('css-datepicker','ui.datepicker.css');
        $CI->codextemplates->js('js-datepicker','ui.datepicker.eu.js');

#94
[eluser]abmcr[/eluser]
The forum insert not permitted charachter: i attach the jpg of correct code

#95
[eluser]abmcr[/eluser]
I want to get the id of the record in the prepForDisplay riutine. I have set this code
Code:
function prepForDisplay($value){
        if(!empty($value))
            return $this->codexadmin->active_id.$this->label; //line 54
        else
            return '';
    }
and i get an error as
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CheckBox::$codexadmin
Filename: plugins/checkbox.php
Line Number: 54
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: plugins/checkbox.php
Line Number: 54

I have set the code as
Code:
function prepForDisplay($value){
        $CI=&get;_instance();
if(!empty($value))
            return $this->CI->codexadmin->active_id.$this->label; //line 54
        else
            return '';
    }
but error also..... what is wrong ? Undecided

#96
[eluser]daulex[/eluser]
[quote author="abmcr" date="1212152058"]The forum insert not permitted charachter: i attach the jpg of correct code[/quote]
I do that, this happens:

Fatal error: Class date_eu: Cannot inherit from undefined class codexforms in /home/sites/galenko.co.uk/public_html/dev/ll/system/application/backend/plugins/date_eu.php on line 3

#97
[eluser]daulex[/eluser]
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Date_eu extends jTabyForms
{
    function Date_eu($name,$params) {
        jTabyForms::initiate($name,$params);
    }

    function prepForDisplay($value){
        if(!empty($value) AND ($value != 0 AND $value != "0000-00-00")){
            $explode = explode('-',$value);
            return date('F j, Y',mktime(0,0,0,$explode[1],$explode[2],$explode[0]));
        }
        else
            return '';
    }
    
    function prepForDB($value){
        $valori=explode("/",$value);
        $date_eu=$valori[2]."-".$valori[1]."-".$valori[0];
        return ($date_eu);
    }

    function getHTML()
    {
        $CI = &get;_instance();
        $CI->codextemplates->css_assets('css-datepicker','ui.datepicker.css');
        $CI->codextemplates->js('js-datepicker','ui.datepicker.eu.js');

        $html = $this->prefix;
        //format the data with eu format
        $valori=explode("-",$this->value);
        $new_date_eu=$valori[2]."/".$valori[1]."/".$valori[0];

        if($this->getMessage($this->name))
            $html .= '<div class="failure">'.$this->getMessage($this->name).'</div>';

        $html .= '
            <label for="'.$this->element_name.'">
                '.$this->label.'
            </label>';
        $html .='
            &lt;input class="text" id="codexdatepicker'.$this-&gt;name.'" type="text" value="'.$new_date_eu.'" name="'.$this->element_name.'" '.$this->getAttributes($this->attributes).'>
        ';
        $js ="$(document).ready(function() {
                $('#codexdatepicker".$this->name."').datepicker({dateFormat: 'dd/mm/yy'});
              });";
        $CI->codextemplates->inlineJS('js-'.$this->name.'-init',$js);
        $html .= $this->suffix;
        
        return $html;
    }
}

can someone rewrite this to work with the jtaby thing instead of codex?
I started at the top, but when I got to $CI->codextemplates-> I didn't know what to put in.

another thing:
the backend seems to be formatting posts either by body or title (the only ones it shows up), I also have id and date fields, why are they not in the sort by list?
update: found where to add id, now I need to change how it sorts it by default, default comes descending order, however I need ascending, how can I achieve that?

thanks

#98
[eluser]abmcr[/eluser]
daulex: if you downaload the latest version, the plugin work fine....

#99
[eluser]Majd Taby[/eluser]
daulex, I'm guessing you downloaded CodeExtinguisher from the website...it's extremely outdated, please download the one from this thread (first post).

abmcr, take a look at line 33 of manytomany.php In your case, you need $CI->codexadmin->active_id.$this->label;

[eluser]abmcr[/eluser]
[quote author="jTaby" date="1212169370"]

abmcr, take a look at line 33 of manytomany.php In your case, you need $CI->codexadmin->active_id.$this->label;[/quote]

Thank you


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.