vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Number Of Posts Needed To Reply to a Thread In Certain Forums (https://vborg.vbsupport.ru/showthread.php?t=44556)

BigJohnson 10-12-2002 11:51 PM

Number Of Posts Needed To Reply to a Thread In Certain Forums
 
Is there a hack out where u need a certain amount of posts to reply to threads in certain forums?

If there is I would love to know wher ei can download it. Also If it is not made I think this would be a great feature. Can someone help me out please. Thanks so much.

I no there is a hack for a certain amount of posts to make a new thread but this is not what i want. Thanks so much for helping me if you can.

Xenon 10-13-2002 09:20 AM

well open your newreply.php
find
PHP Code:

$threadid=verifyid("thread",$threadid);

$threadinfo=getthreadinfo($threadid); 

after that add:
PHP Code:

if($threadinfo[forumid]==and $bbuserinfo[posts]<yshow_nopermission

not very elegant but does what ya want

Chris M 10-13-2002 09:33 AM

I will make a proper hack:)

Satan

Xenon 10-13-2002 09:35 AM

good to hear that chris ;)

Mephisteus 10-13-2002 10:10 AM

Already made by me LONG ago

https://vborg.vbsupport.ru/showthrea...threadid=44571

Thread created for it now, but for gods sake don't go nagging that you have to install another hack first :p.

BigJohnson 10-13-2002 11:53 AM

Yes this is great but i was wondering if it could be a little different.

I need both those hcks minimum to reply and for new thread but i was wondering for like the NEW REPLY HACK.

I made it say u need 5 new threads in order to have a new reply.

Can we change it so you need 5 new threads in certain forums that i choose?

And same goes with the other hac as well. U need a certain amount of posts in order to use this request. Like they need a certain amount of new threads in the specific forums i choose in order to post a new thread in the forum they want to.

I believe we would have to add the forum ID's in with the PHP code i think but how would i go about doing this instead of the way DARKSSJ3 has it where all u need is just a certain amount of new threads in any forum.

Thanks for helping me out guys.

If anyone can do it I would be great appreciated of it. Thanks.

Mephisteus 10-13-2002 12:11 PM

I'll work on it when I get back. Unless someone else already did it :p

BigJohnson 10-13-2002 12:14 PM

Where are you goin? lol. And thanks to whom ever gets it done.

BigJohnson 10-14-2002 12:24 PM

BUMP

BigJohnson 10-16-2002 08:16 AM

Bump. Please someone help me out here.

BigJohnson 10-17-2002 08:18 AM

DarkSS are u still working on this hack?

Mephisteus 10-18-2002 05:11 PM

sorry dude, I just got back from sailing and I'm very tired, and I won't be much home later for the next few weeks so i can't work on the hack... I'll see if someone else can look into it for you

BigJohnson 10-20-2002 11:51 AM

Thanks hellsatan said he could probably make one. Someone please help me out thanks.

BigJohnson 10-22-2002 08:46 AM

bump

Chris M 10-22-2002 12:37 PM

Oh yes...That hack...

I totally forgot about it:(

Sorry;)

Im a bit busy right now...I shall see if I can get it done soon:)

Satan

BigJohnson 10-22-2002 08:16 PM

Thanks so much. This would be so amazing if you can get this done. PLease don't forget about me. Thanks so much.

BigJohnson 10-23-2002 07:22 PM

Bump

BigJohnson 10-25-2002 08:26 AM

Bump

BigJohnson 10-26-2002 11:05 AM

What time do you think you can do this. I think all you go tot do is modify the above hacks posted. I think not to sure lol. When do u think you can do this?

Chris M 10-26-2002 11:49 AM

Im not too sure...

Ive got a busy few days ahead with work etc, but I shall try and get it done:)

Satan

BigJohnson 10-27-2002 03:11 PM

thanks man. hope to here from ya soon.

Xenon 10-28-2002 02:44 PM

well the thread version is not so easy, because there is no threadcounter in the usertable

you need to run this query:
PHP Code:

$threads=$DB_site-query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid]"); 

then you can use $threads[counter] within you ifconditions

BigJohnson 10-28-2002 08:04 PM

So how would this look exactly. I am not to good with php. Do you think you can please tell me what to do maybe. Thanks Xenon

Xenon 10-29-2002 01:45 PM

well instead of this:
PHP Code:

if($threadinfo[forumid]==and $bbuserinfo[posts]<yshow_nopermission

you have to put in this now:
PHP Code:

$threads=$DB_site-query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid]");
if(
$threadinfo[forumid]==and $threads[counter]<yshow_nopermission(); 


BigJohnson 10-30-2002 07:20 PM

PHP Code:

$threads=$DB_site-query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid]");
if(
$threadinfo[forumid]==and $threads[counter]<yshow_nopermission(); 

Do u think u can make directions on where i have to place these bits and pieces of code in the php files. I don't know what to do at all. I no how to run queries i just dont no where ot place all these code.

The hack need to be made so they need a certain amount of threads in certain forums before they can reply in other forums.


Say I have

FORUM1
FORUM2
FORUM3
FORUM4

In order to reply to a thread in FORUM3 you need a certain amount of NEW THREADS in FORUM2 and FORUM3.

That is example but I choose the forumids i need the have the new threads added to and the forum ids of the forums that need the certain amount of new threads before you can reply to as well. Please help me out. I hope you understand because some times i confuse myself hehehe. Thanks Xenon ur the greatest for helping me out so far.

Xenon 10-31-2002 10:34 AM

well all the code belongs to newreply.php

after this:
PHP Code:

if (!$threadinfo[open]) {
  if (!
ismoderator($threadinfo[forumid],"canopenclose")) {
    eval(
"standardredirect(\"".gettemplate("redirect_threadclosed")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
    exit;
  }


add this:
PHP Code:

$threads1=$DB_site-query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid=x"); //For example Forum2
$threads2=$DB_site-query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid=y");  // For example Forum3
if($threadinfo[forumid]==and $threads1[counter]<and $threads2[counter]<yshow_nopermission(); 


BigJohnson 11-02-2002 11:20 AM

What do i actually plug into here?

if($threadinfo[forumid]==x

Also don't you need code in the newthread.php as well to put the certain amount of new threads in that new database query we ran earlier?

For

if($threadinfo[forumid]==x

Dont i need to put more than one number in this area of x? If I do How do i separate each number?

Xenon 11-02-2002 12:49 PM

why to newthread?
you said just replying needs an special ammount of threads already stared....

Quote:

What do i actually plug into here?

if($threadinfo[forumid]==x
well, the forumid of the forum you want a user to be able to reply only if he has a certain ammount of threads created already

BigJohnson 11-02-2002 05:01 PM

"you said just replying needs a special amount of threads already started"

No. lol. What I need is that you need a certain amount of new threads in certain forums before you can make replies in certain forums.

I hope u can still help me out. Sorry to make it so confusing. lol. Thank you Xenon.

Xenon 11-03-2002 07:51 PM

well, can you tell me the exact way you want it?

so say you need 5 threads in forumid 4 and 7 threads in forumid 6 to reply to a thread in forumid 1...

then i can code it the exact way you want it ;)

BigJohnson 11-05-2002 09:52 PM

Ok this sounds great. Here we go.

In order to post replies in forum ID 13, 17, 19, 20, 26, 27, 33, 34, 44, 45, 51, 52, 58, and 59 you need to have at least 5 new threads in the above forum id's. All you need is 5 new threads in any of the forums. You can have them spread out like 1 in each forum to equal up to 5 and that would be fine to post a reply then in the forums.

I think that would be a such a great feature. If you could do that that would be amazing.

Thanks so much Xenon

Xenon 11-06-2002 09:54 AM

ahh, i see, well here we go :)

PHP Code:

$threads=$DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(13, 17, 19, 20, 26, 27, 33, 34, 44, 45, 51, 52, 58, 59)"); 
if(
in_array($threadinfo[forumid],array(13171920262733344445515258,  59 )) and $threads[counter]<5show_nopermission(); 

put this into newreply.php dircetly after:
PHP Code:

if (!$threadinfo[visible]) {
  
$idname="thread";
  eval(
"standarderror(\"".gettemplate("error_invalidid")."\");");
}
if (!
$threadinfo[open]) {
  if (!
ismoderator($threadinfo[forumid],"canopenclose")) {
    eval(
"standardredirect(\"".gettemplate("redirect_threadclosed")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
    exit;
  }



BigJohnson 11-06-2002 10:14 PM

I didn't test it yet but how would we be able to make it so that if you don't have 5 new threads you go to an error page. Can you make it call for a template and I can write out the error message. Can you please post what I should do to do this. Thanks man so much.

BigJohnson 11-07-2002 12:04 AM

Am I suppose to run a query or something. I get this error

Fatal error: Call to undefined function: query_first() in /usr/local/psa/home/vhosts/new-dimensionz.com/httpdocs/messageboard/newreply.php on line 87

Don't I need to change some files in new thread.php as well so it insert the counter info into the wuery?

Xenon 11-07-2002 02:00 PM

redo it, there was a little spelling mistak in it ;)

the other question:
you can replace show_nopermission(); with:
PHP Code:

{
eval(
"standarderror(\"".gettemplate("error_notenoughthreads")."\");");
    exit;    


then create a template error_notenoughthreads and enter a errormessage

BigJohnson 11-07-2002 06:58 PM

Is there any way in the error message to say how many posts they need until they can post replies?

Like You have 2 posts in theses forums out of 5. You need 3 more to be able to reply.

Is there any way to do this so my members no how many more posts they need to make?

Thanks.

Xenon 11-07-2002 07:00 PM

well you should be able to use $threads[counter] in the template, but not sure...

BigJohnson 11-07-2002 10:15 PM

Yes it worked thanks so much. Your the greatest.

Xenon 11-08-2002 12:05 PM

:)

glad to hear :)

you're welcome

BigJohnson 11-08-2002 07:29 PM

Quote:

Originally posted by Xenon
ahh, i see, well here we go :)

PHP Code:

$threads=$DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(13, 17, 19, 20, 26, 27, 33, 34, 44, 45, 51, 52, 58, 59)"); 
if(
in_array($threadinfo[forumid],array(13171920262733344445515258,  59 )) and $threads[counter]<5show_nopermission(); 

put this into newreply.php dircetly after:
PHP Code:

if (!$threadinfo[visible]) {
  
$idname="thread";
  eval(
"standarderror(\"".gettemplate("error_invalidid")."\");");
}
if (!
$threadinfo[open]) {
  if (!
ismoderator($threadinfo[forumid],"canopenclose")) {
    eval(
"standardredirect(\"".gettemplate("redirect_threadclosed")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
    exit;
  }



Ok one more thing. Lol. I am sorry to ask for something else but I was just wondering.

What you did to help me out is that you need a certain amount of new threads before you can reply in those threads.

How would I go about doing something like you need 5 new threads in the forum IDS above in order to post NEW THREADS in forumid's of 21, 28, 35, 46, 53, 61

That would be the greatest. What do ya think ya can do? Tanks for everything Xenon.


All times are GMT. The time now is 02:12 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.01452 seconds
  • Memory Usage 1,867KB
  • 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
  • (13)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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