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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2013, 06:08 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default php script for usergroup promotion = users gets banned !!!

The cron jobs stopped working since a long time on my vbulletin 3.6.4 forum for an unknown reason, so i wrote my own script to promote the users to specific usergroups depending on their post number

Quote:
<?php
include("../db.php");
$current = time();
$unmois = 2629743;
$abc = $current - $unmois;
// membres actifs
$query = "UPDATE vb_user SET usergroupid=9 WHERE posts BETWEEN 14 AND 150 AND usergroupid != 8";
$res = mysql_query($query) or die(mysql_error());
// comit? autogestion
$query = "UPDATE vb_user SET usergroupid=13 WHERE posts > 99 AND joindate < $abc AND usergroupid != 8";
$res = mysql_query($query) or die(mysql_error());
?>
Problem is that all the users gets banned after being promoted !!!

So:

1) What's wrong with my script and why does the users gets banned ?

2) How can i unban all users that were banned for no reason ?
- In ModCP it doesn't show any information about the bans : ban date not available, "banned by" not available, lift date not available
- In vb_userban table, only the users banned by my moderators are shown. The users that got banned automatically after being promoted by my php script are NOT displayed in this table.

--------------- Added [DATE]1377018829[/DATE] at [TIME]1377018829[/TIME] ---------------

Apparently lots of my users are saying that they are on the banlist but they can still post on the forum so i'm not sure what's happenning...

Anyway, how can i promote users to a new group through a php script without putting the users on the banlist ?
Reply With Quote
  #2  
Old 08-21-2013, 01:55 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think it would be better suited for the "coding forum" can a moderator move it to this forum ?
Reply With Quote
  #3  
Old 08-21-2013, 02:10 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NeXuM View Post
The cron jobs stopped working since a long time on my vbulletin 3.6.4 forum for an unknown reason,
I bet'cha this is because for some reason, you might have inadvertently removed the cronimage from the footer. That will make cron stop working, every time.
Reply With Quote
  #4  
Old 08-21-2013, 03:40 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why wouldn't you fix the scheduled tasks instead of writing a custom script to only do one of the many things they do?
Reply With Quote
  #5  
Old 08-21-2013, 04:48 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
I bet'cha this is because for some reason, you might have inadvertently removed the cronimage from the footer. That will make cron stop working, every time.
No.

Quote:
Why wouldn't you fix the scheduled tasks instead of writing a custom script to only do one of the many things they do?
I tried...

https://vborg.vbsupport.ru/showthread.php?t=299778
Reply With Quote
  #6  
Old 08-21-2013, 05:36 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NeXuM View Post
No.
I looked at your source code, didn't see the cronimage.
Reply With Quote
  #7  
Old 08-21-2013, 06:47 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
I looked at your source code, didn't see the cronimage.
It's here. http://www.pirate-punk.net/index.php
Code:
<img src="http://www.pirate-punk.net/cron.php?&amp;rand=920528" alt="" width="1" height="1" border="0" />
Even if i reset the skin to default, cron jobs still aren't working. http://www.pirate-punk.net/index.php?styleid=5

This is the first thing i tried when i had problems with crons. I gave up and i wrote my own scripts. Just need to figure why the users end up being banned (and how to remove the users that were mass banned because of this script)

I'm sure there is a vbulletin file i can include in my php script to use a vb function to promote my users to a new group without having them end up on the banlist.
Reply With Quote
  #8  
Old 08-21-2013, 07:06 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cron.php?&amp;rand=920528" alt="" width="1" height="1" border="0"

In the code, the bolded should not be there. This breaks the string.

And what you should actually have is a hook called, like this:

HTML Code:
<!-- Do not remove $cronimage or your scheduled tasks will cease to function -->
	$cronimage
	<!-- Do not remove $cronimage or your scheduled tasks will cease to function -->
Reply With Quote
  #9  
Old 08-21-2013, 07:24 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code in my footer is
Code:
$cronimage
i don't control how vbulletin outputs it.
Reply With Quote
  #10  
Old 08-21-2013, 07:42 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What kind of trouble shooting have you done so far to see why the cron isnt running?

Is this a dedicate/vps server?
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 02:05 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.04853 seconds
  • Memory Usage 2,262KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_html
  • (6)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
  • (2)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