vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Cron Job (https://vborg.vbsupport.ru/showthread.php?t=326813)

BulliM 10-14-2018 06:49 AM

Cron Job
 
I try to run an own cron job from /core/includes/cron, but I couldn't get it run.

PHP Code:

<?php if (!defined('VB_ENTRY')) die('Access denied.');

$timenow vB::getRequest()->getTimeNow();

$conditions = array();

$assertor vB::getDbAssertor();

$rows $assertor->select('userfield'$conditionsfalse, array('field1''field2''field3''field4''field6''field7'));

I get no result and script aborts at last line. userfield contains all columns in array. No clue what the problem is.

delicjous 10-14-2018 09:00 AM

Do you get any information about the abort?

You need to log and turn to next cron after your code. Look into the vB crons.

BulliM 10-14-2018 09:51 AM

Nope. Logs are empty. I run cron jobs by script (vbcron.php). Other logs (error.log,access.log,mysql.log) don't show anything.

I log steps by file (step_1, step_2 ...) , to see, how far that script works. Before last line is all ok, but at that point it stops.

delicjous 10-14-2018 10:43 AM

At first, there is no userfield table declaration in core/vb/db... or I missed it.

You need to go to vBForum-package.

Try this:
PHP Code:

$rows $assertor->select('vBForum:userfield'$conditionsfalse, array('field1''field2''field3''field4''field6''field7')); 

Or you could use fetchUserFields from core/vb/db... as assertQuery.

BulliM 10-14-2018 10:54 AM

Danke delicious!

This works:
PHP Code:

$rows vB::getDbAssertor()->select('vBForum:userfield'falsefalse, array()); 


rekha 10-17-2018 07:01 AM

nice codes


All times are GMT. The time now is 06:21 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03275 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete