phpbb-auction.com Forum Index phpbb-auction.com
Download, Support, Documentation
 
Donate to phpbb-auction.com to support the project


phpbb-Auction
  Home
   - News
   - Bug report/Patches
   - Future Features
  Demo
  Downloads
   - Version 1.3m  (Core /Lang /Mods)
   - Version 1.2m  (Core /Lang /Mods)
   - Version 1.0m  (Core /Lang /Mods)
   - All
  Services
  Documentation
   - Features
   - Documents
   - How-Tos
   - About
  Support
   - English
   - German
  Development
   - Changlog
   - Requests
   - Team
   - CVS
  Community
   - Website of the Month
   - Websites
   - Community Forum
   - Member

Navigation
FAQFAQ
SearchSearch
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesLog in to check your private messages
Log inLog in

Forum
Changing start time auctions
Sun Feb 07, 2010 4:33 am FR
Easy: what code to use to update sql table?
Fri Oct 16, 2009 8:39 am guyb
Unlimited products(downloads)
Wed Oct 14, 2009 7:09 pm hoimyr
Seller chooses currency
Sun Oct 11, 2009 8:00 pm hoimyr
Cant select end date without getting error
Sun Oct 11, 2009 6:43 pm hoimyr

About
Author: FR
Credits:
Brookfresh, Brad Lawryk, Crogon, DaMysterious, EklipzeDesigns, ML, musashi, phpBB Group, phpBB-Auction-Team, php-styles, sanman, Tel, Vampy, wGEric

Supported Sites





Statistics
User: 17470
Posts: 18401
Latest User: margaretlc2

For all without a cron job Server
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Development
View previous topic :: View next topic  
Author Message
Crogon
Moderator
Moderator


Joined: 17 May 2004
Posts: 574
Location: Anywhere I'm needed.. which is usually everywhere. ;)

PostPosted: Sun Dec 05, 2004 4:31 am    Post subject: Reply with quote

Well, first off, sending out 4500 pm's would probably time out even the fastest servers. With that large of a user base, you really should find a host that lets you use cron jobs inherently. Or perhaps convince your host that it would greatly reduce the load on the server if they did let you use them. Wink

Last edited by Crogon on Tue Jan 11, 2005 11:17 am; edited 1 time in total
Back to top
View user's profile Send private message
burento
Mid-Cap Auctioneer
Mid-Cap Auctioneer


Joined: 20 Dec 2004
Posts: 72

PostPosted: Wed Dec 22, 2004 12:10 pm    Post subject: Reply with quote

This is probably a stupid question..

what are you all talking about.

1. what is this cron thing?

2. How do i know if i can have it on my server.
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Wed Dec 22, 2004 2:06 pm    Post subject: Reply with quote

burento wrote:
1. what is this cron thing?

its a deamon of the linux and allows to run scripts triggered by the time of the machine. it allows you to run for example the auction_cron.php every hour without touching your website. advantage: nobody is slowed down in his navigation because he is triggering the cron (pseudo-cron)

burento wrote:
2. How do i know if i can have it on my server.

Usually the provider tells you in his offer. If your running your own server search for it... Wink
There some service-provider which just offer cron-jobs (sounds a little like blow-job Embarassed ) you register at their website, specify the url of your script and the frequency how often it is supposed to run.
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
burento
Mid-Cap Auctioneer
Mid-Cap Auctioneer


Joined: 20 Dec 2004
Posts: 72

PostPosted: Wed Dec 22, 2004 9:42 pm    Post subject: Reply with quote

I understand.. thank you
Back to top
View user's profile Send private message
burento
Mid-Cap Auctioneer
Mid-Cap Auctioneer


Joined: 20 Dec 2004
Posts: 72

PostPosted: Thu Dec 23, 2004 8:31 am    Post subject: Reply with quote

what command do i put in the make it work.. just the url to auction_cron?

My control panel at my site has cron capabilites.. But it has me put in the command and i am not sure if there is a special way of writing the command
Back to top
View user's profile Send private message
wmtoo
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 06 Jun 2004
Posts: 14

PostPosted: Thu Dec 30, 2004 3:07 am    Post subject: Cron as an option Reply with quote

Well crogon - I'm the captain of my ship, but was forced to have my own server and I think I can do cron jobs, but I believe it's shell related and have no earthly idea how to do that.
Back to top
View user's profile Send private message
treebeard
Large-Cap Auctioneer
Large-Cap Auctioneer


Joined: 14 Sep 2004
Posts: 140
Location: Central Command

PostPosted: Thu Dec 30, 2004 6:10 am    Post subject: Reply with quote

This site will allow you to run cron jobs for free!

http://www.webcron.org

Cheers!!
________
green crack


Last edited by treebeard on Fri Feb 04, 2011 6:53 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
PauldingVoice
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 06 Jan 2005
Posts: 1

PostPosted: Thu Jan 06, 2005 5:52 pm    Post subject: Reply with quote

I just wanted to say that installing the patch and using the above service does the trick. This assumes you can deal with notifications only every hour.

My opinion is that running the auction_cron.php every time someone loads a page, while it works, is not as desireable.

I guess I'm almost ready to bring my auction system on-line Smile.

Good show folks.

B.
Back to top
View user's profile Send private message
Crogon
Moderator
Moderator


Joined: 17 May 2004
Posts: 574
Location: Anywhere I'm needed.. which is usually everywhere. ;)

PostPosted: Tue Jan 11, 2005 11:26 am    Post subject: Re: Cron as an option Reply with quote

wmtoo wrote:
Well crogon - I'm the captain of my ship, but was forced to have my own server and I think I can do cron jobs, but I believe it's shell related and have no earthly idea how to do that.


Hmm.. There is a file somewhere from your internet root up that sets cron job commands to be carried out. If you have Cron jobs enabled that is. Where the file is and exactly what command to use depends entirely on your operating system, and how / where you are defining your internet root. You should be able to locate instructions in a community forum for your operating system, if it's not listed in an FAQ somehwere. Cron jobs are a fairly common server implementation, it's just that many WebAdmins never deal with them since the majority of them use some sort of virtual hosting.

Basically you add in the path and file name of the script that you want executed, then the server takes care of it as needed. Sorry I can't give you specific instructions, but it really depends on your OS and how you have things set up. Confused
Back to top
View user's profile Send private message
dietcoke
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 19 Nov 2004
Posts: 15

PostPosted: Mon Jan 31, 2005 12:42 pm    Post subject: What should I? Reply with quote

treebeard wrote:
This site will allow you to run cron jobs for free!

http://www.webcron.org



What should I fullfill into the field of "UrlUrl"?
Back to top
View user's profile Send private message
dietcoke
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 19 Nov 2004
Posts: 15

PostPosted: Wed Feb 02, 2005 10:30 am    Post subject: Re: What should I? Reply with quote

dietcoke wrote:
treebeard wrote:
This site will allow you to run cron jobs for free!

http://www.webcron.org



What should I fullfill into the field of "UrlUrl"?


is it

http://www.urdomain.com/path_2_auction/auction_cron.php

? Question
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Wed Feb 02, 2005 8:35 pm    Post subject: Re: What should I? Reply with quote

dietcoke wrote:
dietcoke wrote:
treebeard wrote:
This site will allow you to run cron jobs for free!

http://www.webcron.org



What should I fullfill into the field of "UrlUrl"?


is it

http://www.urdomain.com/path_2_auction/auction_cron.php

? Question


yes its the auction_cron.php.
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
tst
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 15 Jan 2005
Posts: 8

PostPosted: Thu Feb 03, 2005 2:06 am    Post subject: You do not need cron job... Reply with quote

Hi

Well, it´s very smart with cron-job to run the file "auction_cron.php" --BUT if your webside is on a server that not can or will do that( My can´t) , you just write the file-name in your browser, and PUFF -the file will be executed. You must do that manually, so many times that you want etc every hour -day -week or what you want. Maybie it´s not the very perfect way to update and send mail to customer, but it works.

I tryed to run the file "auction_cron.php" by FR, --in the first time it dont works on my server and sql-db, so I made some changes.

Especially:

the orginal file way->

// Grab all offers to notify buyer if auction is over and won
$sql = "SELECT FK_auction_offer_user_id,
PK_auction_offer_id,
auction_offer_title,
FK_auction_offer_last_bid_user_id
FROM " . AUCTION_OFFER_TABLE . "
WHERE auction_offer_time_stop<" . time() ." AND
FK_auction_offer_last_bid_user_id<>'' AND
auction_offer_notified_buyer=''";

I have replaced witht this ->

// Grab all offers to notify buyer if auction is over and won
$sql = "SELECT FK_auction_offer_user_id,
PK_auction_offer_id,
auction_offer_title,
FK_auction_offer_last_bid_user_id
FROM " . AUCTION_OFFER_TABLE . "
WHERE (auction_offer_time_stop<" . time() ." OR auction_offer_state=2) AND
FK_auction_offer_last_bid_user_id<>0 AND
auction_offer_notified_buyer=0";

My DB did not accept ->"" but it works with ->0

But take a look, and come with your comments. Or just put the file on your server, and try to run it with a call from your browser, and se what happents.

( NOTICE: if it works - and you not have updatet the DB with sold, auctions ends or etc >>>>auction_offer_notified_buyer=0<<<< or >>>>auction_offer_notified_seller=0<<<<< you will send a lot of mail to your custumers ----- But that´s another thing, and if you want, I have a solution on that too. but now it´s late and I stop here for today.)

TIP: Rename the file, or put it in a safe place on your server - all can execute it with a call.

Sorry about the danish languish in the file (and my english) -- but I´m from the little, but very nice DENMARK Smile

My version of the file "auction_cron.php" :

//-------------begin auction_cron.php - the Braz.dk way
<?php
/***************************************************************************
* auction_cron.php
* -------------------
* begin : July 2004
* copyright : (C) FR
* email : fr@php-styles.com
*
***************************************************************************/

/***************************************************************************
*
* This hack is released under the GPL License.
* This hack can be freely used, but not distributed, without permission.
* Intellectual Property is retained by the author listed above.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include_once($phpbb_root_path . 'auction/auction_common.php');

function notifyUser($user_id, $notify_type, $offer_id, $offer_title)
{
global $db, $lang, $auction_config_data, $board_config;

if ( $auction_config_data['auction_end_notify_email'] )
{
// BEGIN EMAIL-NOTIFY
$sql = "SELECT user_email,
username
FROM " . USERS_TABLE . "
WHERE user_id=" . $user_id . "";

if( !($result = $db->sql_query($sql)) )
{} // if

$user = $db->sql_fetchrow($result);

$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

$username= $user['username'];
$email= $user['user_email'];
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);

if ( $notify_type == 'WON' )
{
$emailer->use_template('auction_won', stripslashes($user_lang));
$emailer->set_subject($lang['auction_won']);
$emailer->assign_vars(array(
'AUCTION_WON' => $lang['auction_offer_won'],
'AUCTION_USERNAME' => $username,
'AUCTION_SITENAME' => $board_config['sitename'],
'AUCTION_OFFER' => prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($offer_title))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0),
'U_AUCTION_OFFER' => $server_protocol . $server_name . $board_config['script_path'] . 'auction_offer_view.php?ao=' . $offer_id,
'AUCTION_EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '' ));
}
if ( $notify_type == 'SOLD' )
{
$emailer->use_template('auction_sold', stripslashes($user_lang));
$emailer->set_subject($lang['auction_sold']);
$emailer->assign_vars(array(
'AUCTION_SOLD' => $lang['auction_offer_sold'],
'AUCTION_USERNAME' => $username,
'AUCTION_SITENAME' => $board_config['sitename'],
'AUCTION_OFFER' => prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($offer_title))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0),
'U_AUCTION_OFFER' => $server_protocol . $server_name . $board_config['script_path'] . 'auction_offer_view.php?ao=' . $offer_id,
'AUCTION_EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '' ));
}
if ( $notify_type == 'NOT_SOLD' )
{
$emailer->use_template('auction_not_sold', stripslashes($user_lang));
$emailer->set_subject($lang['auction_not_sold']);
$emailer->assign_vars(array(
'AUCTION_NOT_SOLD' => $lang['auction_offer_not_sold'],
'AUCTION_USERNAME' => $username,
'AUCTION_SITENAME' => $board_config['sitename'],
'AUCTION_OFFER' => prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($offer_title))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0),
'U_AUCTION_OFFER' => $server_protocol . $server_name . $board_config['script_path'] . 'auction_offer_view.php?ao=' . $offer_id,
'AUCTION_EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '' ));
}

$emailer->email_address($email);

// Try to send email...
$emailer->send();
// $emailer->reset();

} // END EMAIL-NOTIFY

if ( $auction_config_data['auction_end_notify_pm'] )
{

// BEGIN PM-NOTIFY ON OUTBID
if ( $notify_type == 'WON' )
{
$pm_subject = $lang['auction_won'];
$pm_text = $lang['auction_won_text'];
}
if ( $notify_type == 'SOLD' )
{
$pm_subject = $lang['auction_sold'];
$pm_text = $lang['auction_sold_text'];
}
if ( $notify_type == 'NOT_SOLD' )
{
$pm_subject = $lang['auction_not_sold'];
$pm_text = $lang['auction_not_sold_text'];
}

$privmsgs_date = date("U");

$sql = "INSERT INTO " . PRIVMSGS_TABLE . "
(privmsgs_type,
privmsgs_subject,
privmsgs_from_userid,
privmsgs_to_userid,
privmsgs_date,
privmsgs_enable_html,
privmsgs_enable_bbcode,
privmsgs_enable_smilies,
privmsgs_attach_sig)
VALUES ('0',
'" . str_replace("\'", "''", addslashes(sprintf($pm_subject,$board_config['sitename']))) . "',
'2',
" . $user_id . ",
" . $privmsgs_date . ",
'0',
'1',
'1',
'0')";

if ( !$db->sql_query($sql) )
{} // if

$outbid_sent_id = $db->sql_nextid();

$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . "
(privmsgs_text_id,
privmsgs_text)
VALUES (" . $outbid_sent_id .",
'" . str_replace("\'", "''", $pm_text . "</br></br><a href=\"auction_offer_view.php?ao=" . $offer_id . "\">" . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($offer_title))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0) . "</a></br>" . $board_config['board_email_sig'] ) . "')";

if ( !$db->sql_query($sql) )
{
} // if

$sql = "UPDATE " . USERS_TABLE . "
SET user_new_privmsg=user_new_privmsg+1
WHERE user_id=" . $user_id;

if ( !$db->sql_query($sql) )
{} // if

} // End pm-notification

} // end function


/////////////////////////////////////////////////
//
/////////////////////////////////////////////////

include($phpbb_root_path . 'includes/emailer.php');

// Grab all offers to notify buyer if auction is over and won
$sql = "SELECT FK_auction_offer_user_id,
PK_auction_offer_id,
auction_offer_title,
FK_auction_offer_last_bid_user_id
FROM " . AUCTION_OFFER_TABLE . "
WHERE (auction_offer_time_stop<" . time() ." OR auction_offer_state=2) AND
FK_auction_offer_last_bid_user_id<>0 AND
auction_offer_notified_buyer=0";

if( !$result = $db->sql_query($sql) )
{}

$total_notifications = 0;

while( $row = $db->sql_fetchrow($result) )
{
$rowset[] = $row;
$total_notifications++;
} // while

for($i = 0; $i < $total_notifications; $i++)
{
// Write pms and emails
notifyUser($rowset[$i]['FK_auction_offer_last_bid_user_id'], 'WON',$rowset[$i]['PK_auction_offer_id'], $rowset[$i]['auction_offer_title']);

// mark offer buyer-notified
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_notified_buyer=1
WHERE PK_auction_offer_id=" . $rowset[$i]['PK_auction_offer_id'];

if( !$result = $db->sql_query($sql) )
{}// if
$tittel = $rowset[$i]['auction_offer_title'];
echo " - til køber: auktion vundet $tittel - ";
}


// NOTIFY SELLER ON USUAL SOLD
$sql = "SELECT FK_auction_offer_user_id,
PK_auction_offer_id,
auction_offer_title,
FK_auction_offer_last_bid_user_id
FROM " . AUCTION_OFFER_TABLE . "
WHERE auction_offer_time_stop<" . time() ." AND
auction_offer_notified_seller=0";

if( !$result = $db->sql_query($sql) )
{}

$total_notifications = 0;

while( $row = $db->sql_fetchrow($result) )
{
$rowset[] = $row;
$total_notifications++;
} // while

for($i = 0; $i < $total_notifications; $i++)
{
// if no bid
if ( $rowset[$i]['FK_auction_offer_last_bid_user_id'] <> 0)
{
// Write pms and emails
notifyUser($rowset[$i]['FK_auction_offer_user_id'], 'SOLD',$rowset[$i]['PK_auction_offer_id'], $rowset[$i]['auction_offer_title']);
$tittel = $rowset[$i]['auction_offer_title'];
echo " - til sælger: solgt ved bud $tittel - ";
}

else
{
// Write pms and emails
notifyUser($rowset[$i]['FK_auction_offer_user_id'], 'NOT_SOLD',$rowset[$i]['PK_auction_offer_id'], $rowset[$i]['auction_offer_title']);
$tittel = $rowset[$i]['auction_offer_title'];
echo " - til sælger: ikks solgt $tittel - ";
}

// mark offer seller-notified
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_notified_seller=1
WHERE PK_auction_offer_id=" . $rowset[$i]['PK_auction_offer_id'];

if( !$result = $db->sql_query($sql) )
{}// if

}


// NOTIFY SELLER ON DIRECT SELLS
$sql = "SELECT FK_auction_offer_user_id,
PK_auction_offer_id,
auction_offer_title,
FK_auction_offer_last_bid_user_id
FROM " . AUCTION_OFFER_TABLE . "
WHERE auction_offer_state=2 AND
auction_offer_notified_seller=0";

if( !$result = $db->sql_query($sql) )
{}

$total_notifications = 0;

while( $row = $db->sql_fetchrow($result) )
{
$rowset[] = $row;
$total_notifications++;
} // while

for($i = 0; $i < $total_notifications; $i++)
{
// Write pms and emails
notifyUser($rowset[$i]['FK_auction_offer_user_id'], 'SOLD', $rowset[$i]['PK_auction_offer_id'], $rowset[$i]['auction_offer_title']);

// mark offer buyer-notified
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_notified_seller=1
WHERE PK_auction_offer_id=" . $rowset[$i]['PK_auction_offer_id'];

if( !$result = $db->sql_query($sql) )
{}// if
$tittel = $rowset[$i]['auction_offer_title'];
echo " - til sælger: køb nu salg - $tittel ";
}
echo " email sendt - opdatering slut ";
?>
//----------end
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Thu Feb 03, 2005 8:37 am    Post subject: Re: You do not need cron job... Reply with quote

sure it works when you call the auction_cron.php manually.

if your server does not support cron use a webcron-service.

i will take a look on your change. if it works for all my db as well we will make it a standard to work on every server/db.
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
dietcoke
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 19 Nov 2004
Posts: 15

PostPosted: Thu Feb 03, 2005 12:58 pm    Post subject: Poormanscron Reply with quote

Drupal is a kind of CMS, and has a module called Poormanscron.


A module which runs the Drupal cron operations without needing the cron application.

For every page view, this module checks to see if the last cron run was more than 1
hour ago (this period is configurable). If so, the cron hooks are executed, and Drupal is happy. These cron hooks fire after all HTML is returned to the browser, so the user who kicks off the cron jobs should not notice any delay.

quoted form http://drupal.org/project/poormanscron

dunno if it's a good idea? Idea
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Development All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


phpbb-auction.com - Developed by www.digital-media-lab.com
Sponsored by: www.globibo.com - www.learn2go.de - www.talentone.org - www.language-school.in - www.ping-ke.cn