Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #91  
Old 02-23-2005, 11:16 AM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's on line 938 of functions.php?
Reply With Quote
  #92  
Old 02-23-2005, 05:02 PM
zeropaid's Avatar
zeropaid zeropaid is offline
 
Join Date: Nov 2004
Location: San Diego, CA
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
    938         $user $DB_site->query_first("
    939                 SELECT " 
.
    
940                 iif(($option 16), ' administrator.*, ') . "
    941                 userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate,
    942                 IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid" 
.
    
943                 iif(($option 1) AND $vboptions['reputationenable'] == 1', level') .
    
944                 iif(($option 2) AND $vboptions['avatarenabled'], ', avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline').
    
945                 iif(($option 8), ', customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline') .
    
946                 iif(!isset($vbphrase), fetch_language_fields_sql(), '') . "
    947                 FROM " 
TABLE_PREFIX "user AS user
    948                 LEFT JOIN " 
TABLE_PREFIX "userfield AS userfield ON (user.userid = userfield.userid)
    949                 LEFT JOIN " 
TABLE_PREFIX "usertextfield AS usertextfield ON (usertextfield.userid = user.userid) " .
    
950                 iif(($option 1) AND $vboptions['reputationenable'] == 1"LEFT JOIN  " TABLE_PREFIX "reputationlevel AS reputationlevel ON (user.reputationlevelid = reputationlevel.re        putationlevelid) ").
    
951                 iif(($option 2) AND $vboptions['avatarenabled'], "LEFT JOIN " TABLE_PREFIX "avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN " TABLE_PREFIX "customa        vatar AS customavatar ON (customavatar.userid = user.userid) ") .
    
952                 iif(($option 8), "LEFT JOIN " TABLE_PREFIX "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid) ") .
    
953                 iif(($option 16), "LEFT JOIN " TABLE_PREFIX "administrator AS administrator ON (administrator.userid = user.userid) ") .
    
954                 iif(!isset($vbphrase), "INNER JOIN " TABLE_PREFIX "language AS language ON (language.languageid = IF(user.languageid = 0, " intval($vboptions['languageid']) . ", user.        languageid)) ")."
    955                 WHERE user.userid = 
$userid
    956         "
); 
Reply With Quote
  #93  
Old 03-02-2005, 01:10 AM
mtrac's Avatar
mtrac mtrac is offline
 
Join Date: Nov 2004
Location: Edgewater, NJ, USA
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent thread. I hooked the auto-creation up to the CaRP RSS parser and a couple of cron jobs and now have this.

Today's question is how do I create calendar events? I'd be interested in a year at a time; i.e. monthly board meeting schedules. I'm thinking of inserting a text file into vb3_event with PHPMyAdmin but would like something more sophisticated.

Thanks.
Reply With Quote
  #94  
Old 03-02-2005, 10:59 AM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mtrac
Excellent thread. I hooked the auto-creation up to the CaRP RSS parser and a couple of cron jobs and now have this.

Today's question is how do I create calendar events? I'd be interested in a year at a time; i.e. monthly board meeting schedules. I'm thinking of inserting a text file into vb3_event with PHPMyAdmin but would like something more sophisticated.

Thanks.
Search here for news2vb also...
Reply With Quote
  #95  
Old 03-07-2005, 11:03 PM
zeropaid's Avatar
zeropaid zeropaid is offline
 
Join Date: Nov 2004
Location: San Diego, CA
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I figured out my problem. Has anyone got this code to work inside a function? When I run it normally, it works fine. When I put it inside a function, I get all kinds of errors.
Reply With Quote
  #96  
Old 03-08-2005, 11:21 AM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zeropaid
Ok, I figured out my problem. Has anyone got this code to work inside a function? When I run it normally, it works fine. When I put it inside a function, I get all kinds of errors.
Can you post what you're doing?
Reply With Quote
  #97  
Old 03-11-2005, 09:09 PM
zeropaid's Avatar
zeropaid zeropaid is offline
 
Join Date: Nov 2004
Location: San Diego, CA
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?
require_once("../classes/nested.php");
require_once("../classes/form.php");
require_once("../classes/mysql.php");

$nested = new Nested;
$forms = new Forms;

function doforum () {
global $forumcache;


# Do forum stuff

 chdir('/usr/local/www/htdocs/bbs');

// Load vB-Backend

$globaltemplates = array();
$specialtemplates = array();
$actiontemplates = array();

#require_once('./includes/db_mysql.php');
require_once('./global.php');
require_once('./includes/functions_newpost.php');

#if ($_POST[news_user_id] == 0 || !$_POST[news_user_id]) {
#        $userid = 1;
#} else {
#        $userid = 1;
#}

//$userid = $_POST[news_user_id]; // The user creating the thread
$userid = 1;
$forumid = 34; // The forum where the thread should be posted

// Get forum & user info
$foruminfo = fetch_foruminfo($forumid);
$bbuserinfo = fetch_userinfo($userid);

#print_r($bbuserinfo);

$title = "this is the title";
$article = "this is the body of the article where the text would go.... need to parse html out, maybe just link to the story";

// Setup the thread
$post[title] = $title;
$post[message] = $article;
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
$post[emailupdate] = 9999;

// build the thread
build_new_post('thread', $foruminfo, array(), 0, $post, $errors);

// Errors?
if (sizeof($errors) > 0) {
  ?>There have been errors. <?=$errors?><?
  print_r($errors);
  die('errors');
}

$ThreadID = $post['threadid'];
$PostID = $post['postid'];

print ("the threadid is $ThreadID and the postid is $PostID");
}

doforum();
?>

Which returns:

Warning: array_keys() [function.array-keys]: The first argument should be an array in /includes/functions.php on line 3089

Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3089

Fatal error: Call to a member function query() on a non-object in /usr/local/www/htdocs/bbs/includes/functions.php on line 2298

Fatal error: Call to undefined method stdClass::query() in /usr/local/www/htdocs/bbs/includes/functions.php on line 524

I also have the same code outside a function, which works fine:

PHP Code:
<?
require_once("../classes/nested.php");
require_once("../classes/form.php");
require_once("../classes/mysql.php");

$nested = new Nested;
$forms = new Forms;

global $forumcache;


# Do forum stuff

 chdir('/usr/local/www/htdocs/bbs');

// Load vB-Backend

$globaltemplates = array();
$specialtemplates = array();
$actiontemplates = array();

#require_once('./includes/db_mysql.php');
require_once('./global.php');
require_once('./includes/functions_newpost.php');

#if ($_POST[news_user_id] == 0 || !$_POST[news_user_id]) {
#        $userid = 1;
#} else {
#        $userid = 1;
#}

//$userid = $_POST[news_user_id]; // The user creating the thread
$userid = 1;
$forumid = 34; // The forum where the thread should be posted

// Get forum & user info
$foruminfo = fetch_foruminfo($forumid);
$bbuserinfo = fetch_userinfo($userid);

#print_r($bbuserinfo);

$title = "this is the title";
$article = "this is the body of the article where the text would go.... need to parse html out, maybe just link to the story";

// Setup the thread
$post[title] = $title;
$post[message] = $article;
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
$post[emailupdate] = 9999;

// build the thread
build_new_post('thread', $foruminfo, array(), 0, $post, $errors);

// Errors?
if (sizeof($errors) > 0) {
  ?>There have been errors. <?=$errors?><?
  print_r($errors);
  die('errors');
}

$ThreadID = $post['threadid'];
$PostID = $post['postid'];

print ("the threadid is $ThreadID and the postid is $PostID");
?>
It seems like it is missing some data inside that function or something.
Reply With Quote
  #98  
Old 03-12-2005, 04:45 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't really go through your code, but try getting the userinfo before the foruminfo.
Reply With Quote
  #99  
Old 03-14-2005, 04:23 AM
zeropaid's Avatar
zeropaid zeropaid is offline
 
Join Date: Nov 2004
Location: San Diego, CA
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah the code is pretty long and convoluted, the bottom line is when i run it just in a normal test script it works perfectly, when I put it in any sort of function construct it fails as soon as it tries to execute any vb code.
Reply With Quote
  #100  
Old 03-17-2005, 01:22 AM
Lee Wilde's Avatar
Lee Wilde Lee Wilde is offline
 
Join Date: Apr 2004
Location: Perth, Australia
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may be interested in this hack just released by deathemperor:

Calendar Search and Comments for Events
https://vborg.vbsupport.ru/showthread.php?p=626269
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:14 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04752 seconds
  • Memory Usage 2,289KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete