Forums / General / fetch problem, doesn`t work properly

fetch problem, doesn`t work properly

Author Message

Mieczyslaw Morzonek

Tuesday 06 July 2004 6:08:01 am

I`ve the url somthing like this

ez/index.php/cms/trainees?mode=false&id=181

I want to sort by attribute 181, so i i`ve write something like this

fetch( 'content', 'list', hash( 'parent_node_id' , 
$node.node_id, 
'sort_by' ,
array('attribute' , concat(ezhttp( 'mode', 'get' ),"()")
, ezhttp( 'id', 'get' )),
'class_filter_type' ,  'include',
'class_filter_array', array( 'trainee' ) ) )}

I can not sort by ASC or DESC. The problem is in (ezhttp( 'mode', 'get' ),"()"). I don`t know how to construct true() or false form my URL. This source code (ezhttp( 'mode', 'get' ),"()") is not VISIBLE for the FETCH function.

Thanks for any help

Mieczyslaw Morzonek

Tuesday 06 July 2004 11:43:28 pm

I really need help, please. I need to sort data for every column of my table ASC or DESC... There is no {if} operator in ez templates?

Paul Forsyth

Wednesday 07 July 2004 3:26:37 am

Sometimes its good to separate out different function calls, eg:

{let getMode=ezhttp('mode','get')
     getID=ezhttp('id', 'get')
     result=fetch( 'content', 'list', hash( 'parent_node_id' , $node.node_id,
                                            'sort_by' , array('attribute' , concat($getMode,"()", $getID)),
                                            'class_filter_type' , 'include',
                                            'class_filter_array', array( 'trainee' ) ) )}

paul

--
http://www.visionwt.com

Mieczyslaw Morzonek

Wednesday 07 July 2004 5:42:14 am

Paul thank you for your idea, but it doesn`t work. I ve change part of your code {concat($getMode,"()", $getID)} to {concat($getMode,"(), ", $getID)} now the last parametr "ID" in`t visible for fetch function. I ve sql error ...

Query error: Something is wrong in your syntax near 'AND
                                   a0.version = ezcontentobj' in linie 18
  WHERE
                           path_string like '/1/2/67/%' and  depth <= 3 and 
                          
                          
                                   a0.contentobject_id = ezcontentobject.id AND
                                   a0.contentclassattribute_id =  AND // line 18
                                   a0.version = ezcontentobject_name.content_version AND
                                   a0.language_code = ezcontentobject_name.real_translation AND 

 

Any other idea how to sort data in table via columns ASC or DESC clicking column name? Is it {if} operator in ez templates?

{if $var == something}

... syntax

{elseif $var == something}

... syntax

{/if}

i ve also traing like this but it`s still doesn`t work

getMode=concat(ezhttp('mode','get'),"()")

I don`t know why? How to submit this 2 variables "mode" and "id" to fetch function?

I lost hope to solve this problem :( Is this a somekind of bug?

Paul Forsyth

Wednesday 07 July 2004 1:30:13 pm

THere is an 'if' operator. Use section:

{section show=eq($test, 1)}
Do something

 {section show=eq($test, 2)}
Do something different
 {/section}

{section-else}
Do something else
{/section}

Are you looking to create a true/false value for your sort_by array? Putting in text wont work - the value needs to a proper true/false value.

Hope this helps

paul

--
http://www.visionwt.com

Mieczyslaw Morzonek

Thursday 08 July 2004 3:42:00 am

It`s working. Paul u are great :) I ve used {section} to build my fetch syntax. In Smarty {if} operator is much confortable in use that {section} in ez templates.

Thanks!

Paul Forsyth

Thursday 08 July 2004 3:56:35 am

Excellent. Yip, i feel using sections for ifs are clumsy. The benefit is that section can be used for lots of other things.

At the end of the day it is just another language syntax that we have to learn as programmers. I've learnt lots of languages in my time and quickly learnt not to worry about naming choices :)

paul

PS. Very weird error. Edits appear in two places..............:

--
http://www.visionwt.com

Paul Forsyth

Thursday 08 July 2004 4:02:33 am

Sorry for the double post. Hit a weird weird problem:

http://ez.no/community/bug_reports/forum_editing_problem

!!!

paul

--
http://www.visionwt.com

eZ debug

Timing: Jan 19 2025 01:02:03
Script start
Timing: Jan 19 2025 01:02:03
Module start 'content'
Timing: Jan 19 2025 01:02:04
Module end 'content'
Timing: Jan 19 2025 01:02:04
Script end

Main resources:

Total runtime0.7187 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.9688180.8359
Module start 'content' 0.00840.5815 769.8047542.4766
Module end 'content' 0.58990.1287 1,312.2813341.7891
Script end 0.7186  1,654.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5495210.0002
Check MTime0.00150.2146210.0001
Mysql Total
Database connection0.00100.133210.0010
Mysqli_queries0.638588.84672090.0031
Looping result0.00190.26712070.0000
Template Total0.681294.820.3406
Template load0.00200.281820.0010
Template processing0.679294.504320.3396
Template load and register function0.00030.046310.0003
states
state_id_array0.00330.463410.0033
state_identifier_array0.00130.185920.0007
Override
Cache load0.00180.2538560.0000
Sytem overhead
Fetch class attribute can translate value0.00120.168130.0004
Fetch class attribute name0.00100.137280.0001
XML
Image XML parsing0.00050.063030.0002
class_abstraction
Instantiating content class attribute0.00000.005580.0000
General
dbfile0.00580.8045210.0003
String conversion0.00000.001330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 36
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs