vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Auto-create topic? (https://vborg.vbsupport.ru/showthread.php?t=83138)

LeeWicKeD 06-15-2005 01:38 PM

Auto-create topic?
 
hi there,

i'm looking for a hack, that can create topics on a specified time/date. i want to create the topic before and set the time when it should be posted into a forum.i hope you understand what i mean ;)

is there already any released hack?

i already tried the search, but just got this hack:

https://vborg.vbsupport.ru/showthread.php?t=80770

but this won't work and does not seem to be the hack i need.

Lee

edit: just found this one: https://vborg.vbsupport.ru/showthread.php?t=61030

but i'm not able to create my own phpfile/hack because i don't know anything about php ;)

Colin F 06-15-2005 03:08 PM

Quote:

Originally Posted by LeeWicKeD
but i'm not able to create my own phpfile/hack because i don't know anything about php

Try it ;)
It's not that hard and we all started once.
We'll even help you if you have specific questions...

LeeWicKeD 06-21-2005 12:17 PM

:ninja:

ok i got this code from the other topic:

PHP Code:

<?
require('./global.php');
require('./includes/functions_newpost.php');
$userid = 4703;
$forumid = 84;
$foruminfo = fetch_foruminfo($forumid);
$bbuserinfo = fetch_userinfo($userid);
$post[title] = 'Testtopic';
$post[message] = 'Just a Test';
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
build_new_post('thread', $foruminfo, array(), 0, $post, $errors);
?>

i put all this into a .php file and uploaded it to my webspace.
ok when i run the .php file in my browser i get a blank page, and the topic was created in forum with id 84.
ok so far it's ok ;)

but i want to change the userid,forumid,$post[title],$post[message] and $post[poststarttime] through a form in the adminpanel. so that ONLY administrators can pre-create their topics.

what's the format for the $post[poststarttime]? instead of TIMENOW i want to use a specified date and time.

thanks for help :)
Lee

Andreas 06-21-2005 12:29 PM

Quote:

Originally Posted by LeeWicKeD
but i want to change the userid,forumid,$post[title],$post[message] and $post[poststarttime] through a form in the adminpanel. so that ONLY administrators can pre-create their topics.

Then you must create a CP file for this.

Quote:

what's the format for the $post[poststarttime]? instead of TIMENOW i want to use a specified date and time.
It's a UNIX Timestamp, eg. the seconds since the epoch (01.01.1970 00:00:00).

LeeWicKeD 06-21-2005 12:42 PM

tried 1119383100 (for 06/21/05 15:45) instead of TIMENOW, but it still creates the topic instant ?!

Andreas 06-21-2005 12:44 PM

It will always create the Thread instantly, no matter what poststarttime is set to - it will just show up to be created at this time.

If you want it to be hidden until a certain point in the future, you will have to set it to be hidden and have a cron-job to make invisible threads show up when the time has passed.

LeeWicKeD 06-21-2005 12:46 PM

ah i though it's possible to change the poststarttime so that it will create a topic on a specified date+time ?

Andreas 06-21-2005 12:47 PM

No, that's certainly not possible.

LeeWicKeD 06-21-2005 01:03 PM

but i already saw it in a forum ;) ok but i could try it with a vbcron ;)

..

Colin F 06-21-2005 01:16 PM

Quote:

Originally Posted by LeeWicKeD
but i already saw it in a forum ;) ok but i could try it with a vbcron ;)

..

Yes.

You'd basically save it in a different table and copy it to the thread table with vBCron

LeeWicKeD 06-21-2005 01:37 PM

ok i got it. but it isn't user-friendly :)
i created a .php file named actopic.php, then i created a new cron via admincp. but now there are 2 problems left:
1. the cron is executed every month again (if i don't delete it before)
2. i still cannot change the values userid,forumid,$post[title],$post[message] and $post[poststarttime] in admincp ;) how can i do this? i know i need to create a new file...but problem 1 is more important.

for example:
i create a file named actopic_admin.php. with this file i can change the values and create a new cron, that executes actopic.php. at the end of actopic.php i would add a line that deletes the cron again. is this possible?

lee

Andreas 06-21-2005 01:43 PM

Why are you making it that complicated?

1.) Create a CP file with Inputs for Userid, Forumid, Title, Message and Posttime
2.) Let this CP file create the threads - hidden
3). Create a cronjob that runs once every hour and makes Threads visible that are currently invisible, but according to their dateline should be visible by now and are not under moderation..

LeeWicKeD 06-21-2005 03:05 PM

@kirbyde: sounds good, i'll give it a try.

ok i tried to create such a cp file...by copying & pasting from other hacks... but i don't know what is wrong ;)

just tried to create such "input_rows". may anyone take a look at my php file? :(


All times are GMT. The time now is 12: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.01164 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
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete