Jump to content

Michael

Moderators
  • Posts

    9,522
  • Joined

  • Last visited

  • Days Won

    186

Everything posted by Michael

  1. I'll get one up for you now mate. Video completed: http://screencast.com/t/jQm2aqmdAECn
  2. I'm not sure as I'm only learning to make modules (not going well at the moment haha) But this is the code and it seems to be coming from above it if your right because this is to spit an error out. if ($until) { throw new TemplateSyntaxError('Unclose tag, expecting '. $until[0]); }
  3. Try using the code from mine, I don't have that issue. <?php class H2o_Lexer { function __construct($options = array()) { $this->options = $options; $trim = ''; if ($this->options['TRIM_TAGS']) $trim = '(?:\r?\n)?'; $this->pattern = ('/\G(.*?)(?:' . preg_quote($this->options['BLOCK_START']). '(.*?)' .preg_quote($this->options['BLOCK_END']) . $trim . '|' . preg_quote($this->options['VARIABLE_START']). '(.*?)' .preg_quote($this->options['VARIABLE_END']) . '|' . preg_quote($this->options['COMMENT_START']). '(.*?)' .preg_quote($this->options['COMMENT_END']) . $trim . ')/sm' ); } function tokenize($source) { $result = new TokenStream; $pos = 0; $matches = array(); preg_match_all($this->pattern, $source, $matches, PREG_SET_ORDER); foreach ($matches as $match) { if ($match[1]) $result->feed('text', $match[1], $pos); $tagpos = $pos + strlen($match[1]); if ($match[2]) $result->feed('block', trim($match[2]), $tagpos); elseif ($match[3]) $result->feed('variable', trim($match[3]), $tagpos); elseif ($match[4]) $result->feed('comment', trim($match[4]), $tagpos); $pos += strlen($match[0]); } if ($pos < strlen($source)){ $result->feed('text', substr($source, $pos), $pos); } $result->close(); return $result; } } class H2o_Parser { var $first; var $storage = array(); var $filename; var $runtime; function __construct($source, $filename, $runtime, $options) { $this->options = $options; //$this->source = $source; $this->runtime = $runtime; $this->filename = $filename; $this->first = true; $this->lexer = new H2o_Lexer($options); $this->tokenstream = $this->lexer->tokenize($source); $this->storage = array( 'blocks' => array(), 'templates' => array(), 'included' => array() ); } function &parse() { $until = func_get_args(); $nodelist = new NodeList($this); while($token = $this->tokenstream->next()) { //$token = $this->tokenstream->current(); switch($token->type) { case 'text' : $node = new TextNode($token->content, $token->position); break; case 'variable' : $args = H2o_Parser::parseArguments($token->content, $token->position); $variable = array_shift($args); $filters = $args; $node = new VariableNode($variable, $filters, $token->position); break; case 'comment' : $node = new CommentNode($token->content); break; case 'block' : if (in_array($token->content, $until)) { $this->token = $token; return $nodelist; } @list($name, $args) = preg_split('/\s+/',$token->content, 2); $node = H2o::createTag($name, $args, $this, $token->position); $this->token = $token; } $this->searching = join(',',$until); $this->first = false; $nodelist->append($node); } if ($until) { throw new TemplateSyntaxError('Unclose tag, expecting '. $until[0]); } return $nodelist; } function skipTo($until) { $this->parse($until); return null; } # Parse arguments static function parseArguments($source = null, $fpos = 0){ $parser = new ArgumentLexer($source, $fpos); $result = array(); $current_buffer = &$result; $filter_buffer = array(); $tokens = $parser->parse(); foreach ($tokens as $token) { list($token, $data) = $token; if ($token == 'filter_start') { $filter_buffer = array(); $current_buffer = &$filter_buffer; } elseif ($token == 'filter_end') { if (count($filter_buffer)) { $i = count($result)-1; if ( is_array($result[$i]) ) $result[$i]['filters'][] = $filter_buffer; else $result[$i] = array(0 => $result[$i], 'filters' => array($filter_buffer)); } $current_buffer = &$result; } elseif ($token == 'boolean') { $current_buffer[] = ($data === 'true'? true : false); } elseif ($token == 'name') { $current_buffer[] = symbol($data); } elseif ($token == 'number' || $token == 'string') { $current_buffer[] = $data; } elseif ($token == 'named_argument') { $last = $current_buffer[count($current_buffer) - 1]; if (!is_array($last)) $current_buffer[] = array(); $namedArgs =& $current_buffer[count($current_buffer) - 1]; list($name,$value) = array_map('trim', explode(':', $data, 2)); # if argument value is variable mark it $value = self::parseArguments($value); $namedArgs[$name] = $value[0]; } elseif( $token == 'operator') { $current_buffer[] = array('operator'=>$data); } } return $result; } } class H2O_RE { static $whitespace, $seperator, $parentheses, $pipe, $filter_end, $operator, $boolean, $number, $string, $i18n_string, $name, $named_args; static function init() { $r = 'strip_regex'; self::$whitespace = '/\s+/m'; self::$parentheses = '/\(|\)/m'; self::$filter_end = '/;/'; self::$boolean = '/true|false/'; self::$seperator = '/,/'; self::$pipe = '/\|/'; self::$operator = '/\s?(>|<|>=|<=|!=|==|!|and |not |or )\s?/i'; self::$number = '/\d+(\.\d*)?/'; self::$name = '/[a-zA-Z_][a-zA-Z0-9-_]*(?:\.[a-zA-Z_0-9][a-zA-Z0-9_-]*)*/'; self::$string = '/(?: "([^"\\\\]*(?:\\\\.[^"\\\\]*)*)" | # Double Quote string \'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\' # Single Quote String )/xsm'; self::$i18n_string = "/_\({$r(self::$string)}\) | {$r(self::$string)}/xsm"; self::$named_args = "{ ({$r(self::$name)})(?:{$r(self::$whitespace)})? : (?:{$r(self::$whitespace)})?({$r(self::$i18n_string)}|{$r(self::$number)}|{$r(self::$name)}) }x"; } } H2O_RE::init(); class ArgumentLexer { private $source; private $match; private $pos = 0, $fpos, $eos; private $operator_map = array( '!' => 'not', '!='=> 'ne', '==' => 'eq', '>' => 'gt', '<' => 'lt', '<=' => 'le', '>=' => 'ge' ); function __construct($source, $fpos = 0){ if (!is_null($source)) $this->source = $source; $this->fpos=$fpos; } function parse(){ $result = array(); $filtering = false; while (!$this->eos()) { $this->scan(H2O_RE::$whitespace); if (!$filtering) { if ($this->scan(H2O_RE::$operator)){ $operator = trim($this->match); if(isset($this->operator_map[$operator])) $operator = $this->operator_map[$operator]; $result[] = array('operator', $operator); } elseif ($this->scan(H2O_RE::$boolean)) $result[] = array('boolean', $this->match); elseif ($this->scan(H2O_RE::$named_args)) $result[] = array('named_argument', $this->match); elseif ($this->scan(H2O_RE::$name)) $result[] = array('name', $this->match); elseif ($this->scan(H2O_RE::$pipe)) { $filtering = true; $result[] = array('filter_start', $this->match); } elseif ($this->scan(H2O_RE::$seperator)) $result[] = array('separator', null); elseif ($this->scan(H2O_RE::$i18n_string)) $result[] = array('string', $this->match); elseif ($this->scan(H2O_RE::$number)) $result[] = array('number', $this->match); else throw new TemplateSyntaxError('unexpected character in filters : "'. $this->source[$this->pos]. '" at '.$this->getPosition()); } else { // parse filters, with chaining and ";" as filter end character if ($this->scan(H2O_RE::$pipe)) { $result[] = array('filter_end', null); $result[] = array('filter_start', null); } elseif ($this->scan(H2O_RE::$seperator)) $result[] = array('separator', null); elseif ($this->scan(H2O_RE::$filter_end)) { $result[] = array('filter_end', null); $filtering = false; } elseif ($this->scan(H2O_RE::$boolean)) $result[] = array('boolean', $this->match); elseif ($this->scan(H2O_RE::$named_args)) $result[] = array('named_argument', $this->match); elseif ($this->scan(H2O_RE::$name)) $result[] = array('name', $this->match); elseif ($this->scan(H2O_RE::$i18n_string)) $result[] = array('string', $this->match); elseif ($this->scan(H2O_RE::$number)) $result[] = array('number', $this->match); else throw new TemplateSyntaxError('unexpected character in filters : "'. $this->source[$this->pos]. '" at '.$this->getPosition()); } } // if we are still in the filter state, we add a filter_end token. if ($filtering) $result[] = array('filter_end', null); return $result; } # String scanner function scan($regexp) { if (preg_match($regexp . 'A', $this->source, $match, null, $this->pos)) { $this->match = $match[0]; $this->pos += strlen($this->match); return true; } return false; } function eos() { return $this->pos >= strlen($this->source); } /** * return the position in the template */ function getPosition() { return $this->fpos + $this->pos; } } ?>
  4. We'll need Paul, Cody or Tyson to help you on this as I don't have any experience with Plesk mate.
  5. No problem, that's what we are here for
  6. General mate
  7. Ok mate sorry for the late reply 1. Set up cPanel or DirectAdmin or even Plesk module. 2. Go to the groups make one called hosting or shared hosting. 3. Make a order form maybe called hosting and select the group. 4. Make a package, select the module (cPanel, DirectAdmin, Plesk) and then select the server. You need to select the package from the dropdown, select the prices you wish to charge. Select the hosting group and save.
  8. Oh ok v3 1. Activate Logicboxes / Namecheap modules depending who you use. 2. Make a group called domains. 3. Make a order form set as Domains and other. 4. Make packages. Title TLD like .com | set module as Logicboxes / Namecheap. | select the tld checkbox. | put 1 year and the price. Save to the group domains. I'll do a video if you would like.
  9. If your starting fresh wouldn't it be better if you used the v3?
  10. /components/gateways/nonmerchant/offline
  11. I think that would be cool if you did do that in the future with the backend google oauth.
  12. Ah you can't use that mate, that's aimed at v3. 2.5 is at it's end of life stage, it's being converted to v3. What I did is: 1. Set up Module (Logicboxes) 2. Inputed my information in it. 3. created a package using the Logicboxes module. eg: .com 4. finished all domains. 5. Then got ready to import from whm** to v2.5 After. Then I got the AWES from the 2.5 config and started importing from 2.5 to v3.
  13. I've not tried that yet myself but I would of thought they worked, Paul, Cody and Tyson would be best to answer this for you. No-one in Beta tried them else it would of been fixed if it was a bug :s
  14. No problem, it's a bit of a bugger that tool haha. I need to know how to set it up probably.
  15. Do you have PHPIDs installed? It happened to me in beta because it didn't like some of the tags I used. Simple fix if you do is turn it off.
  16. Ah learn something new every day haha, not sure why it worked for me then :s. http://screencast.com/t/ugMjFYL4 so weird.
  17. oh I installed it with EasyApache when configuring the server .
  18. I thought blesta-new.php stayed there. I have both blesta-new.php and blesta.php. But I suppose I just copy the files over when upgrading so that's probably why.
  19. Same I've not had a issue but I thought mbstring was a function most hosts have enabled, and we've used v3 from Beta haha.
  20. Yeah Cody said it's not supposed to do that when I was talking about it in the Beta period but that was the last I heard of it.
  21. Oh yeah of course you can as-long as you keep Blesta's copyright on it I believe your free to copy it.
  22. Would Blesta be able to support this for the client side two and only uses the information it has on the registration form? So if I clicked on Facebook, It would import my full name, date of birth, email address, etc .
  23. Michael

    Piping Emails.

    Thanks mate this solved my issue: /usr/bin/php /home/username/public_html/index.php plugin/support_manager/ticket_pipe/index/2/
  24. We can't do dropdowns on the universal module yet, we don't know how to haha. You can do it a addon group and assign it to a form and then make products for that addon group. They then show up as bullet points. Eg: http://billing.licensecart.com/plugin/order/main/configure/blesta/?pricing_id=57&group_id=7
  25. Michael

    Piping Emails.

    Ah I see, is there a way I could say use the index style haha. That way worked for me and I think Kyle had it working that way. Or a option in the settings in 3.1.0 where you choose which to use index.php or the pipe.php so people like directadmin can use pipe.php and we can use the index.php for cPanel.
×
×
  • Create New...