vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   php script for usergroup promotion = users gets banned !!! (https://vborg.vbsupport.ru/showthread.php?t=301392)

NeXuM 08-19-2013 06:08 PM

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 ?

NeXuM 08-21-2013 01:55 PM

I think it would be better suited for the "coding forum" can a moderator move it to this forum ?

Max Taxable 08-21-2013 02:10 PM

Quote:

Originally Posted by NeXuM (Post 2439804)
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.

Zachery 08-21-2013 03:40 PM

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

NeXuM 08-21-2013 04:48 PM

Quote:

Originally Posted by Max Taxable (Post 2440132)
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

Max Taxable 08-21-2013 05:36 PM

Quote:

Originally Posted by NeXuM (Post 2440192)
No.

I looked at your source code, didn't see the cronimage.

NeXuM 08-21-2013 06:47 PM

Quote:

Originally Posted by Max Taxable (Post 2440202)
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.

Max Taxable 08-21-2013 07:06 PM

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 -->


NeXuM 08-21-2013 07:24 PM

The code in my footer is
Code:

$cronimage
i don't control how vbulletin outputs it.

snakes1100 08-21-2013 07:42 PM

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

Is this a dedicate/vps server?


All times are GMT. The time now is 08:41 AM.

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.01188 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete