Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 05-29-2009, 02:47 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i tryed somthings but i can't get it to work

this is the code
Code:
function updateThread($id, $ut){
	
	$db->query_write("UPDATE vb3_thread SET sortdateline = maildateline, mailed = '0', open = '1' WHERE threadid = '$id' AND maildateline = '$ut' AND forumid = '46' ");
	return (mysql_affected_rows() == 1);
}
this is the error
Quote:
Fatal error: Call to a member function on a non-object in /var/www/vhosts/zeewaterforum.info/httpdocs/forums/verkoopfunctions.php on line 103
when i put $vbulletin-> in front of the line of code that also isn't working


this is a php file which is called from a link send by email.

bellow a bit of code from the email
Quote:
Heeft u uw artikelen nog niet verkocht, dan kunt u met onderstaande url uw advertentie '3 dagen' naar voren plaatsen:
http://www.zeewaterforum.info/forums...&ut=1242763003



this is the php file verplaats.php
Code:
<?php

require_once('./global.php');
require_once('./verkoopfunctions.php');
	if(isset($_GET['id'])&&isset($_GET['ut'])){

		if(updateThread($_GET['id'], $_GET['ut'])){
			standard_error('Uw bericht is naar voren verplaatst','',0);
		}
		else{
			standard_error('Er is niets gewijzigd, u heeft uw bericht waarschijnlijk al eerder verplaatst.','',0);
		}
	}
	else{
		standard_error('Er klopt iets niet met de URL, verzeker u dat de volledige URL is gekopieerd','',0);
	}


?>

this is the whole php file verkoopfunctions.php
Code:
<?php

require_once('htmlMimeMail.php');

function doall(){

  setSortDateLine();
	closeOldThreads();
	setThreads();
	$result = getThreads();
	while(($row = mysql_fetch_array($result))==true){
	//	echo 'postuserid '.$row['postuserid'].'  MAILDATELINE'.$row['maildateline'].'<BR>';
		sendmail($row['postuserid'],$row['threadid'],$row['maildateline'],$row['title']);
        //sendpm($row['postuserid'],$row['threadid'],$row['maildateline'],$row['title']);
        //setsend($row['threadid']);
	}
}

function sendmail($userid, $threadid, $ut, $threadtitle){
	global $mail;

	$user = $db->query("SELECT username, email FROM vb3_user WHERE userid = '$userid'");
	$user = $db->fetch_array($user);
	//$headers = "MIME-Version: 1.0\n";
	//$headers .= "From: administratie@zeewaterforum.info\n";
	$name = $user['username'];
	$email = 'test@steinor.nl'; //$user['email'];
	$subject = "Actualiseren aanbieding";
	$message = "Hallo ".$name. ",<br/><br/>";
	$message .= "\n\nOp zeewaterforum.info heeft u de advertentie \"".$threadtitle."\" geplaatst in het forumdeel \"Particulieren bieden aan\".<br/>\n";
	$message .= "Het is nu 3 dagen geleden dat u deze advertentie (voor het laatst naar voren) heeft geplaatst.<br/>\n<br/>\n";
	$message .= "Heeft u uw artikelen nog niet verkocht, dan kunt u met onderstaande url uw advertentie '3 dagen' naar voren plaatsen:<br/>\n";
	$message .= "<a href =\"http://www.zeewaterforum.info/forums/verplaats.php?id=$threadid&ut=$ut\">http://www.zeewaterforum.info/forums/verplaats.php?id=$threadid&ut=$ut</a><br/>\n<br/>\n";
	$message .= "Mocht u uw artikelen reeds hebben verkocht dan kunt u met onderstaande url uw advertentie op slot zetten en naar achter plaatsen:<br/>\n";
	$message .= "<a href =\"http://www.zeewaterforum.info/forums/sluit.php?id=$threadid&ut=$ut\">http://www.zeewaterforum.info/forums/sluit.php?id=$threadid&ut=$ut</a><br/>\n<br/>\n";
	$message .= "Reageert u niet, dan wordt uw advertentie over twee dagen automatisch op slot gezet.\nU kunt dan alsnog reageren, uw advertentie wordt dan weer van het slot gehaald.<br/>\n<br/>\n";
	$message .= "Met vriendelijke groet,<br/>\n<br/>\nHet zeewaterforum.info team";


	$mail = new htmlMimeMail();
	$mail->setFrom('zeewaterforum.info <noreply@zeewaterforum.info>');
	$mail->setSubject($subject);

    $mail->setHTML($message);
	$mail->setBcc('l.k.h.kwakman@orange.nl');
  $mail->send(array($email));
}

function setsend($threadid){
    $db->query("UPDATE vb3_thread SET mailed = '1' WHERE threadid = '$threadid'");
}

function sendpm($userid, $threadid, $ut, $threadtitle){

    $user = $db->query("SELECT username, email FROM vb3_user WHERE userid = '$userid'");
    $user = $db->fetch_array($user);
    $username = $user['username'];

    $title = "Actualiseren aanbieding";
    $message = "Hallo ".$name. ",";
    $message .= "\n\nOp zeewaterforum.info heeft u de advertentie \"".$threadtitle."\" geplaatst in het forumdeel \"Particulieren bieden aan\".\n";
    $message .= "Het is nu 3 dagen geleden dat u deze advertentie (voor het laatst naar voren) heeft geplaatst.\n\n";
    $message .= "Heeft u uw artikelen nog niet verkocht, dan kunt u met onderstaande url uw advertentie '3 dagen' naar voren plaatsen:\n";
    $message .= "http://www.zeewaterforum.info/forums...adid}&ut={$ut}\n\n";
    $message .= "Mocht u uw artikelen reeds hebben verkocht dan kunt u met onderstaande url uw advertentie op slot zetten en naar achter plaatsen:\n";
    $message .= "http://www.zeewaterforum.info/forums...adid}&ut={$ut}\n\n";
    $message .= "Reageert u niet, dan wordt uw advertentie over twee dagen automatisch op slot gezet.\nU kunt dan alsnog reageren, uw advertentie wordt dan weer van het slot gehaald.\n\n";
    $message .= "Met vriendelijke groet,\n\nHet zeewaterforum.info team";

    $tostring = array();
    $tostring["$userid"] = $username;

    $fusername = "forumbeheer";
    $fuserid = "47";
                    // insert private message text
    $db->query("INSERT INTO vb3_pmtext(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie) VALUES ($fuserid, '$fusername', '$title', '" . addslashes($message) . "', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 0, 0)");
    echo mysql_error();
    // get the inserted private message id
    $pmtextid = mysql_insert_id();


    $db->query("INSERT INTO vb3_pm (pmtextid, userid) VALUES ($pmtextid, $userid)");

    // update recipient pm totals (with pm-popup)

    $db->query("UPDATE vb3_user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid = '$userid'");


}

function closeThread($id, $ut){
	$db->query("UPDATE vb3_thread SET open = '0' WHERE threadid = '$id' AND forumid = '46' AND maildateline = '$ut'");
	return (mysql_affected_rows() == 1);
}

function closeOldThreads(){
	$db->query("UPDATE vb3_thread SET open = '0', mailed = '0' WHERE open = '1' AND forumid = '46' AND TIMESTAMP(FROM_UNIXTIME( maildateline ) , '48:00:00') < NOW() AND mailed = '1'");
}

function updateThread($id, $ut){
	
	$vbulletin->$db->query_write("UPDATE vb3_thread SET sortdateline = maildateline, mailed = '0', open = '1' WHERE threadid = '$id' AND maildateline = '$ut' AND forumid = '46' ");
	return (mysql_affected_rows() == 1);
}

function getThreads(){
	return $db->query("SELECT * FROM vb3_thread LEFT JOIN vb3_deletionlog AS deletionlog ON(vb3_thread.threadid = deletionlog.primaryid AND type = 'thread') WHERE maildateline <> sortdateline AND mailed = '0' AND open = '1' AND forumid = 46 AND ISNULL(deletionlog.primaryid) ORDER BY maildateline DESC LIMIT 50");
}

function setThreads(){
	$db->query("UPDATE vb3_thread SET maildateline = UNIX_TIMESTAMP(TIMESTAMP( FROM_UNIXTIME( sortdateline ) , '72:00:00')) WHERE sortdateline = maildateline AND TIMESTAMP(FROM_UNIXTIME( sortdateline ) , '72:00:00') < NOW() AND open = '1' AND forumid = 46");
}

function setSortDateLine(){
	$db->query("UPDATE vb3_thread SET sortdateline = dateline, maildateline = dateline WHERE sortdateline = '0' AND open = '1' AND forumid = '46'");
}

?>
Reply With Quote
 


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 10:51 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.05249 seconds
  • Memory Usage 2,536KB
  • Queries Executed 12 (?)
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
  • (4)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (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)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete