vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Permission to post, only if userid is the owner of the thread? (https://vborg.vbsupport.ru/showthread.php?t=168450)

ArchangelX 01-22-2008 07:18 AM

Permission to post, only if userid is the owner of the thread?
 
Hi all...I know that you can restrict users by usergroup...but I have a comment system that I'm trying to figure out...where I only want the user that owns the comment section to post. It's like their own personal journal sorta thing.

I'm trying to figure out what the code is that would keep only the userid of the person that owns the journal to post.

I hope this makes sense...thanks for the help...I'm really new to this.

Dismounted 01-22-2008 07:41 AM

So, basically a blog?

ArchangelX 01-22-2008 07:53 AM

Yepz...sorta like that. I'm thinking I can do it in the template rather than in the PHP.

Similar to how Member Info works...I just want the Add Comment button to not show if the person doesn't own the page.

I've tried <if condition="$userinfo[userid] == $vbulletin->userinfo[userid]">

But it doesn't work. Am I doing something wrong? I've included global.php in the .php for the system.

Dismounted 01-22-2008 07:56 AM

Code:

<if condition="$thread['postuserid'] == $vbulletin->userinfo['userid']">
It doesn't prevent someone from accessing the post reply URL directly though...

ArchangelX 01-22-2008 07:59 AM

Well...see...that's the problem. This isn't using VB's thread system...it's a homegrown...that's why I just want to disable it by not showing it?

So...basically...just giving the person the only allowance to make comments. I suck at coding...I've been looking for the answer all night...they say the best way to learn is to do it yourself, and that's what I've been doing, but it's hard...heh.

Thanks for your help...any ideas on how to restrict it simply on User ID?

Dismounted 01-22-2008 08:12 AM

Well, I really can't help you if you're not using the vBulletin thread system, as I don't know how it works.

ArchangelX 01-22-2008 08:19 AM

Ahh...well, I basically just want to make an <if> statement that excludes the member if he's not the owner of the page...just like memberinfo. To explain it again...it has nothing to do with the comments itself...I just want to hide a button.

So how would I hide a button depending on whether or not that person owned that page...you know what I mean? Like say if it was a button on User CP...

Gah. Still searching...

Dismounted 01-22-2008 08:37 AM

It is an easy conditional, but I don't have any information on how the script works, so no matter how much you explain to me in words, I won't have the variables to compare.

ArchangelX 01-22-2008 08:41 AM

Woot! Figured it out! I was able to use the ids that I had alread defined in the MySQL tables.

Thanks for your help, Dismounted...I sincerely appreciate it! Sorry if I sounded frustrated, I've been working at this all day! Thanks!

lordtopcat 03-20-2008 07:19 PM

Just out of interest, how did you get it to work?

Cheers


All times are GMT. The time now is 10:24 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.00957 seconds
  • Memory Usage 1,726KB
  • 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_code_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
  • (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