Inserting article through code problem

Author Message

Kåre Køhler Høvik

Monday 05 July 2004 3:55:23 am

Try adding this to the start of your script :

include_once( 'kernel/classes/ezscript.php' );
$script =& eZScript::instance( array( 'debug-message' => '',
                                      'use-session' => true,
                                      'use-modules' => true,
                                      'use-extensions' => true ) );
$script->startup();
$script->setUseSiteAccess( $siteaccess );
$script->initialize();

Replace $siteaccess with your admin siteaccess.

--
Kåre Høvik

Kåre Høvik

Lior Solomon

Monday 05 July 2004 4:37:40 am

THANKS GOD!!!!
ein od milvado
thanks mate
i would really apreciate if you would mention it somewhere in you documantation
not talking about your fency new book
please i can imagine how many people waisted their time for this mistory
thanks again

Lior

Paul Forsyth

Tuesday 06 July 2004 6:44:55 am

You also need to explain your problem better. Your original post said nothing about the fact were using examples from the book.

paul

--
http://www.visionwt.com

Olav Bringedal

Thursday 24 February 2005 1:49:46 am

When doing this on the class "product" we got the same problems mentioned here. When we copied product-class and used that class instead, it worked like a dream. Something to do with access-rights maybe?


Senior Consultant
http://Umoe-consulting.no

Marvix Marx

Thursday 04 January 2007 6:33:36 pm

Hi there ..

did any one tested on 3.9 ?
How to run the code .. from ezp or stand alone ?
Where from will import the data ?

thx in adv

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:09:49
Script start
Timing: Jan 18 2025 19:09:49
Module start 'layout'
Timing: Jan 18 2025 19:09:49
Module start 'content'
Timing: Jan 18 2025 19:09:50
Module end 'content'
Timing: Jan 18 2025 19:09:50
Script end

Main resources:

Total runtime0.9439 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.5781152.6406
Module start 'layout' 0.00770.0041 742.218839.9063
Module start 'content' 0.01180.9306 782.1250658.8203
Module end 'content' 0.94240.0015 1,440.945314.2891
Script end 0.9438  1,455.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3924160.0002
Check MTime0.00130.1420160.0001
Mysql Total
Database connection0.00080.086110.0008
Mysqli_queries0.879293.1469680.0129
Looping result0.00060.0651660.0000
Template Total0.897595.120.4488
Template load0.00330.345820.0016
Template processing0.894394.741220.4471
Template load and register function0.00010.010710.0001
states
state_id_array0.00160.173510.0016
state_identifier_array0.00140.152720.0007
Override
Cache load0.00250.2603330.0001
Sytem overhead
Fetch class attribute can translate value0.00040.046550.0001
Fetch class attribute name0.00040.047580.0001
XML
Image XML parsing0.00330.344950.0007
class_abstraction
Instantiating content class attribute0.00000.001380.0000
General
dbfile0.00350.3761270.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs