PHx - MODX Community Forums https://forums.modx.com/board/?board=83 <![CDATA[ [SOLVED] PHX triggers event log: $modx->recordCount() is deprecated function]]> https://forums.modx.com/thread/95507/solved-phx-triggers-event-log-modx--recordcount-is-deprecated-function#dis-post-518872
} else if ($modx->recordCount($result) == 0){ // If snippet not found, look in the modifiers folder


This only appears to have started happening after installing the MODX 1.0.15 update.

Does this mean PHX needs updating? It also appears to be used by AjaxSearch as well.]]>
https://forums.modx.com/thread/95507/solved-phx-triggers-event-log-modx--recordcount-is-deprecated-function#dis-post-518872 Wed, 21 Jan 2015 02:12:11 +0000 https://forums.modx.com/thread/95507/solved-phx-triggers-event-log-modx--recordcount-is-deprecated-function#dis-post-518872
<![CDATA[Display if manager user]]> https://forums.modx.com/thread/45352/display-if-manager-user#dis-post-497341
Essentially I want to be able to include links for manager users for help pertaining to particular pages, or possibly include a link to a Ditto listing for the manager to jump to & edit that page using QM+ (otherwise the listing would just be text and not a public accessible link.)

I have found a few similar questions in the forum but did not see a solution–I apologize if I just missed it.

Thanks!]]>
https://forums.modx.com/thread/45352/display-if-manager-user#dis-post-497341 Thu, 08 May 2014 05:17:27 +0000 https://forums.modx.com/thread/45352/display-if-manager-user#dis-post-497341
<![CDATA[Evo 1.0.13rc2 - Error : Undefined index: webInternalKey]]> https://forums.modx.com/thread/89081/evo-1-0-13rc2---error-undefined-index-webinternalkey#dis-post-489977 When I set on errors (config/user/detection/detact all) I see:

Error : Undefined index: webInternalKey

/assets/plugins/phx/phx.parser.class.inc.php

Backtrace
1	DocumentParser->executeParser()
index.php on line 144
2	DocumentParser->prepareResponse()
manager/includes/document.parser.class.inc.php on line 1621
3	DocumentParser->parseDocumentSource()
manager/includes/document.parser.class.inc.php on line 1711
4	DocumentParser->invokeEvent()
manager/includes/document.parser.class.inc.php on line 1487
5	DocumentParser->evalPlugin()
manager/includes/document.parser.class.inc.php on line 3393
6	eval()
manager/includes/document.parser.class.inc.php on line 1006
7	PHxParser->PHxParser()
manager/includes/document.parser.class.inc.php(1006) : eval()'d code on line 5


]]>
https://forums.modx.com/thread/89081/evo-1-0-13rc2---error-undefined-index-webinternalkey#dis-post-489977 Thu, 13 Feb 2014 07:47:15 +0000 https://forums.modx.com/thread/89081/evo-1-0-13rc2---error-undefined-index-webinternalkey#dis-post-489977
<![CDATA[PHx Fresh Install... Fatal Error Cannot redeclare class...]]> https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-474874
I just installed PHx exactly as said in the documentation and i have this error:
Fatal error: Cannot redeclare class PHxParser in /homez.63/acbsesam/v2/assets/plugins/phx/phx.parser.class.inc.php on line 12

Line 12:
class PHxParser {


MODx Evo 1.0 / YAMS 1.1.7 RC7 / MM 0.3.4 / PHx 2.1.3
PHP 5.2.11 / MySQL 5.0.68]]>
https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-474874 Tue, 13 Aug 2013 06:16:51 +0000 https://forums.modx.com/thread/45374/phx-fresh-install-fatal-error-cannot-redeclare-class#dis-post-474874
<![CDATA[PHx 2.2.0-rc "@" bug]]> https://forums.modx.com/thread/84563/phx-2-2-0-rc-bug#dis-post-466652
I think I found a bug in the newly release PHx 2.2.0 RC. In some cases if text contains the @ sign the parser stops working

[+phx:input=`[+my-richt-text+]`:len:gt=`0`:then=`
	<div class="row">
		[+my-richt-text+]
	</div>
`+]


I also attached an image to show how it looks. Note the @ sign in the text. Same thing works with the previous PHx version

]]>
https://forums.modx.com/thread/84563/phx-2-2-0-rc-bug#dis-post-466652 Sat, 18 May 2013 12:04:52 +0000 https://forums.modx.com/thread/84563/phx-2-2-0-rc-bug#dis-post-466652
<![CDATA[Why does PHx evaluate the "else" clause when it's false?]]> https://forums.modx.com/thread/45415/why-does-phx-evaluate-the-else-clause-when-it-s-false?page=2#dis-post-463843 On a product page there’s a chunk that shows all of the product’s attributes.
So a PHx statement evaluates the template id and picks the correct TV for each attribute. Here’s the code:

[*phx:if=`[*template*]`:eq=`22`:then=`[[Ditto?&documents=`[*optionsTempRoof*]`&tpl=`@FILE:assets/chunks/templates/product_option_related_tpl.chk`]]`:else=`[[Ditto?&documents=`[*optionsPermRoof*]`&tpl=`@FILE:assets/chunks/templates/product_option_related_tpl.chk`]]`*]


The problem is that for every product only one TV exists. I would expect that in the example above PHx would evaluate from left to right and if the "eg=`22`" condition is true would output the value and stop. But it doesn’t. It continues to evaluate the statement in the "else" clause, finds the "optionsPerm2Roof" tv, and since it doesn’t exist throws this error:

« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[*optionsPermRoof*]) AND sc.published=1 AND sc.deleted=0) AND (' at line 3 »
      SQL: SELECT DISTINCT sc.id FROM `smartspacedb`.`modx_site_content` sc LEFT JOIN `smartspacedb`.`modx_document_groups` dg on dg.document = sc.id WHERE (sc.id IN ([*optionsPermRoof*]) AND sc.published=1 AND sc.deleted=0) AND (sc.privateweb=0) GROUP BY sc.id
      [Copy SQL to ClipBoard]
 
Parser timing
  MySQL: 	0.0100 s	(14 Requests)
  PHP: 	0.1448 s	 
  Total: 	0.1548 s


If i change "optionsPermRoof" in the else clause to "optionsTempRoof", i.e. a TV that exists everything works fine. Is there a way to force PHx to stop evaluating after a true condition has been met?
]]>
https://forums.modx.com/thread/45415/why-does-phx-evaluate-the-else-clause-when-it-s-false?page=2#dis-post-463843 Mon, 22 Apr 2013 06:10:26 +0000 https://forums.modx.com/thread/45415/why-does-phx-evaluate-the-else-clause-when-it-s-false?page=2#dis-post-463843
<![CDATA[How to add values of two TVs]]> https://forums.modx.com/thread/45338/how-to-add-values-of-two-tvs#dis-post-455012
I would like to display a value on page which is simply two TVs added together.

I have a TV called initialpayment and another called finalpayment.  I want to add them together and display on a page.

I’ve never used PHX before.  I’m assuming this is a job for PHX?  I suspect I’m stuck on the syntax.  I’ve tried about a hundred variations can’t seem to get it right.  I get either a parse error or no value is displayed.  Can someone show me how its done?

Here’s the latest I’ve tried.

<p>[*projectcost:math?`[*initialpayment*]+[*finalpayment*]`*]</p>]]>
https://forums.modx.com/thread/45338/how-to-add-values-of-two-tvs#dis-post-455012 Wed, 13 Feb 2013 10:45:52 +0000 https://forums.modx.com/thread/45338/how-to-add-values-of-two-tvs#dis-post-455012
<![CDATA[ [SOLVED] PHx AND and OR help please]]> https://forums.modx.com/thread/74967/solved-phx-and-and-or-help-please#dis-post-415658
        [+maxigallery.picture.depth:isnot=``:or:is=`0`:then=`
            <li title="depth">[+maxigallery.picture.depth:htmlent+]d </li>
        `+]

but I get always the unwanted output. What's wrong?
I also tested this code, where I would like to suppress any ouput if the values are not present:
[+maxigallery.picture.width:isnot=``:and:
maxigallery.picture.height:isnot=``:and:
maxigallery.picture.depth:isnot=``:and:
maxigallery.picture.units:isnot=``:
then=`output`+]
but I have no output both with any value present that none.
What's wrong with my code? thank you
]]>
https://forums.modx.com/thread/74967/solved-phx-and-and-or-help-please#dis-post-415658 Mon, 12 Mar 2012 03:41:25 +0000 https://forums.modx.com/thread/74967/solved-phx-and-and-or-help-please#dis-post-415658
<![CDATA[help with PHx in a form ("selected" option value)]]> https://forums.modx.com/thread/74898/help-with-phx-in-a-form-selected-option-value#dis-post-415263 selected="selected" to opiton values based on their value, but my code doesn't work:
            <label for="[+maxigallery.fieldnames.unit+]">units:</label> 
            <select name="[+maxigallery.fieldnames.unit+]" id="[+maxigallery.fieldnames.unit+]" value="[+maxigallery.picture.unit:htmlent+]" onkeydown="document.editform.[+maxigallery.fieldnames.modified+].value='yes'">
                <option value="mm" [+maxigallery.picture.unit:htmlent:is=`mm`:then=`selected="selected"`+]>mm</option>
                <option value="cm" [+maxigallery.picture.unit:htmlent:is=`cm`:then=`selected="selected"`+]>cm</option>
                <option value="m" [+maxigallery.picture.unit:htmlent:is=`m`:then=`selected="selected"`+]>m</option>
                <option value="variable" [+maxigallery.picture.unit:htmlent:is=`variable`:then=`selected="selected"`+]>variable</option>
            </select>

no one of the values has the attribute. Where am I wrong?
This is a template of a Maxigallery (beta) module, on evo.]]>
https://forums.modx.com/thread/74898/help-with-phx-in-a-form-selected-option-value#dis-post-415263 Thu, 08 Mar 2012 10:41:58 +0000 https://forums.modx.com/thread/74898/help-with-phx-in-a-form-selected-option-value#dis-post-415263
<![CDATA[moved server and PHx just stopped working]]> https://forums.modx.com/thread/73354/moved-server-and-phx-just-stopped-working#dis-post-408732
I recently moved an Evo 1.0.5 site to a new server and PHx has stopped working. Haven't changed a thing with PHx in the manager, but any data previously generated by PHx is just not appearing at the new location.

Here's the current server setup:
Apache version 2.2.21
PHP version 5.3.8
MySQL version 5.1.56-log

The phx directory is set to 755, Template Service Events set at OnParseDocument.

Here's the previous server setup:
Apache: 2.2.3
PHP version 5.2.17
MySQL version 5.0.77

Could the server difference here be causing the problem?

Thanks in advance]]>
https://forums.modx.com/thread/73354/moved-server-and-phx-just-stopped-working#dis-post-408732 Mon, 23 Jan 2012 08:00:58 +0000 https://forums.modx.com/thread/73354/moved-server-and-phx-just-stopped-working#dis-post-408732
<![CDATA[PHx and Reflect]]> https://forums.modx.com/thread/45327/phx-and-reflect#dis-post-406468
Reflect Call (BTW I’ve tried this cached/uncached):
[!Reflect?  &id=`reflectArchive` &config=`@FILE {{template-path}}configs/reflect/testimonial-archive.config.php`!]


Inside the Reflect Template PHP:
$tplItem ='@CODE <li class="reflect_month"><a href="[~[+parent+]~]#testimonial_[+id+]" title="[+pagetitle+]" class="reflect_month_link">[+pagetitle+][+description:ucase+]</a>[+wrapper+]</li>'


When I remove the :ucase modifier, the [+description+] placeholder appears, so there is data in there. Forcing PHx on in the template has no effect.]]>
https://forums.modx.com/thread/45327/phx-and-reflect#dis-post-406468 Mon, 09 Jan 2012 04:09:09 +0000 https://forums.modx.com/thread/45327/phx-and-reflect#dis-post-406468
<![CDATA[PHX not working after saver update]]> https://forums.modx.com/thread/72731/phx-not-working-after-saver-update#dis-post-404502
However on now updating our website content the PHX used within template seems to stops working which of course completely messes up our site templates.

At current we are unable to make any changes to the site as this simply stops PHX from functioning.

Any ideas on where within PHX we should start looking for issues?]]>
https://forums.modx.com/thread/72731/phx-not-working-after-saver-update#dis-post-404502 Thu, 22 Dec 2011 07:25:50 +0000 https://forums.modx.com/thread/72731/phx-not-working-after-saver-update#dis-post-404502
<![CDATA[PHx and EasyEvents]]> https://forums.modx.com/thread/45336/phx-and-easyevents?page=3#dis-post-404114
I’ve activated PHx and EasyEvent doesn’t work anymore.
chunk which works with PHx off:
[+miniCalPlaceholder+]

[+listDetailsPlaceholder+][+missingEventsMessagePlaceholder+]
[!EasyEvents_ListMini? &nodes=`103`!] 


chunk, which I thought it could work:
[+phx:input=`[+miniCalPlaceholder+]`+]

[+phx:input=`[+listDetailsPlaceholder+]`+]
[+phx:input=`[+missingEventsMessagePlaceholder+]`+]

[+phx:input=`[!EasyEvents_ListMini? &nodes=`69`!]`+] 


I really don’t know what I’m doing undecided]]>
https://forums.modx.com/thread/45336/phx-and-easyevents?page=3#dis-post-404114 Mon, 19 Dec 2011 05:37:50 +0000 https://forums.modx.com/thread/45336/phx-and-easyevents?page=3#dis-post-404114
<![CDATA[PHx, Template Variables and Wayfinder]]> https://forums.modx.com/thread/45350/phx-template-variables-and-wayfinder#dis-post-400809
If its 1 then this means to hide the entry from the sitemap.

<li[+wf.id+][+wf.classes+]>
[+phx:if=`[+sitemap_exclude+]`:is=`0`:then=`[+sitemap_exclude+]`+]
[+sitemap_exclude+] -- 
<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+]</li>


The problem is:

1) If I do this:

[+phx:if=`[+sitemap_exclude+]`:is=`1`:then=`{{Sitemap_rowTpl}}`+]


Nothing ever appears.

I am trying to figure out what I am doing wrong with respects to the PHX, I want it to do this:

1. If the [+sitemap_exclude+] = 1 then show the list-item in my Wayfinder &rowTpl

But for some reason it doesn’t work.

What is the correct way of doing this?]]>
https://forums.modx.com/thread/45350/phx-template-variables-and-wayfinder#dis-post-400809 Sun, 20 Nov 2011 12:57:47 +0000 https://forums.modx.com/thread/45350/phx-template-variables-and-wayfinder#dis-post-400809
<![CDATA[Modx Evo, getchunk & PHX]]> https://forums.modx.com/thread/45430/modx-evo-getchunk-phx#dis-post-262385
I’m trying to call a chunk with placeholder.

It’s working only for classic placeholder, not for test with PHX.
Example :
$modx->setPlaceholder('id', $row["id"]);
$modx->setPlaceholder('pagetitle', $row["pagetitle"]);
$modx->setPlaceholder('description', $row["description"]);
$modx->setPlaceholder('introtext', $row["introtext"]);
$resultat.= $modx->getChunk('mytpl');


And mytpl :
 <div class="texte">
        <table>
          <tr>
            <td class="titre">
              <h2><a href="/[~[+id+]~]" title="[+longtitle+]">[+pagetitle+]</a></h2>
            </td>
            <td class="description">
              [+phx:if=`[+description+]`:is=``:then=``:else=`<a href="/[~[+id+]~]" title="[+longtitle+]">[+description+]</a>`+]
              <a href="/[~[+id+]~]" title="[+longtitle+]">[+introtext+]</a></p>
              <p class="date"><a href="/[~[+id+]~]">[[afficheDate? &id=`[+id+]`]]</a></p>
            </td>
          </tr>
        </table>
      </div>


The PHX is not executed ...

Do you have any idea this problem ?

Thanks for helping

Cyril]]>
https://forums.modx.com/thread/45430/modx-evo-getchunk-phx#dis-post-262385 Tue, 02 Aug 2011 04:32:35 +0000 https://forums.modx.com/thread/45430/modx-evo-getchunk-phx#dis-post-262385
<![CDATA[PHx parse error]]> https://forums.modx.com/thread/45383/phx-parse-error#dis-post-262178
PHx is working just perfect but their is a little issue. When I’ve it enabled online and change any settings in the admin panel, siteCache file is changed and show the local server path.

If I disable PHx, then it does not happen.

Here is the error:

« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »

PHP error debug
Error: include_once(D:/phpserv/www/clickedsol/assets/plugins/phx/phx.parser.class.inc.php) [function.include-once]: failed to open stream: No such file or directory
Error type/ Nr.: Warning - 2
File: /home/design4m/public_html/apps/clickedsol/manager/includes/document.parser.class.inc.php(746) : eval()’d code
Line: 9

Parser timing
MySQL: 0.0013 s (3 Requests)
PHP: 0.0203 s
Total: 0.0217 s]]>
https://forums.modx.com/thread/45383/phx-parse-error#dis-post-262178 Fri, 24 Jun 2011 10:41:49 +0000 https://forums.modx.com/thread/45383/phx-parse-error#dis-post-262178
<![CDATA[PHx Error]]> https://forums.modx.com/thread/45429/phx-error#dis-post-262384
I am trying to install PHx on MODx Revolution 2.0.8-p traditional, however I keep getting the following error

Fatal error: Class ’PHxParser’ not found in /home/creative/public_html/modx-2.0.8-pl/core/cache/elements/modplugin/3.include.cache.php on line 25

I am not really sure how to fix can anyone help??? is it that i am just installing in the wrong place??

Thanks in advance

Louise]]>
https://forums.modx.com/thread/45429/phx-error#dis-post-262384 Thu, 09 Jun 2011 11:24:26 +0000 https://forums.modx.com/thread/45429/phx-error#dis-post-262384
<![CDATA[ [SOLVED] Revo equivalent of PHX for the math function]]> https://forums.modx.com/thread/45428/solved-revo-equivalent-of-phx-for-the-math-function#dis-post-262382
Easy with PHx, but does anyone know the equivalent in Revo output modifiers? Can’t see anything in the documentation.

Thanks


EDIT sorry just saw the math function in Output Modifiers... whoops!]]>
https://forums.modx.com/thread/45428/solved-revo-equivalent-of-phx-for-the-math-function#dis-post-262382 Mon, 23 May 2011 05:01:33 +0000 https://forums.modx.com/thread/45428/solved-revo-equivalent-of-phx-for-the-math-function#dis-post-262382
<![CDATA[IF snippet or Output Filters (PHx)?]]> https://forums.modx.com/thread/45427/if-snippet-or-output-filters-phx#dis-post-262381 I wonder which one is better to use. The IF snippet or generally output filters (in Revo) or PHx in Evo?
I tried to benchmark performance (timings), but can’t really tell..

Does anyone know the difference / which one is faster?

Thanks.
Jakub]]>
https://forums.modx.com/thread/45427/if-snippet-or-output-filters-phx#dis-post-262381 Sat, 30 Apr 2011 12:36:22 +0000 https://forums.modx.com/thread/45427/if-snippet-or-output-filters-phx#dis-post-262381
<![CDATA[SOLVED phx parser error]]> https://forums.modx.com/thread/45426/solved-phx-parser-error#dis-post-262378
When im logged in and preview the website i get these errors below.
When i refresh that page the error is gone.
When i clear cache the error comes back, it’s only when im logged into the cms!

Modx 1.0.5 with phx 2.1.4 and phx:phpthumb 0.3


Parse error: syntax error, unexpected ')' in /usr/home/nwebbrbkvv/domains/xxx.nl/public_html/assets/plugins/phx/phx.parser.class.inc.php(220) : eval()'d code on line 1

Parse error: syntax error, unexpected ')' in /usr/home/nwebbrbkvv/domains/xxx.nl/public_html/assets/plugins/phx/phx.parser.class.inc.php(226) : eval()'d code on line 1

]]>
https://forums.modx.com/thread/45426/solved-phx-parser-error#dis-post-262378 Wed, 20 Apr 2011 07:16:19 +0000 https://forums.modx.com/thread/45426/solved-phx-parser-error#dis-post-262378