Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 07-01-2002, 07:51 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Request - Users can edit a post, until an Admin notifies it is not editable?

Ive got a Request...

Normally, if you didnt want users to edit their posts, you would turn the settings off...

Now...I could go and invidually disallow them to edit posts in that forum, but that isnt what I want either...

I want a little Tick Box to appear in Edit Post, and when an Admin or a Mod ticks it, the user cannot edit that post again until it is un-ticked...

Now...Can this be done?

Satan
Reply With Quote
  #2  
Old 07-01-2002, 08:21 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, i hope i can code it without testing it

first of all make a new fiel in the post-table called editable small int standart 1

then open your editpost.php

find this:
PHP Code:
if ($bbuserinfo[userid]!=$postinfo[userid]) {
        
// check user owns this post
        
show_nopermission();
      } else { 
replace with
PHP Code:
if ($bbuserinfo[userid]!=$postinfo[userid] or $postinfo[editable]==0) {
        
// check user owns this post
        
show_nopermission();
      } else { 

PHP Code:
eval("dooutput(\"".gettemplate("editpost")."\");"); 
before add:
PHP Code:
if ($bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid]==5) {
    eval(
"\$admineditpost = \"".gettemplate("admineditpost")."\";");
  } else {
    
$admineditpost "";
  } 
thats part of my "More Functions in Edit Post if you are an Admin" hack

create new template $admineditpost contains:
Code:
<tr>
	<td bgcolor="#DFDFDF" nowrap><normalfont><b>Post editable</b>
<input type="radio" name="editable" value="yes"> yes
		<input type="radio" name="editable" value="no"></normalfont></td>
</tr>
then find
PHP Code:
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'"); 
and replace it with:
PHP Code:
if($bbuserinfo[usergroupid]!=and $bbuserinfo[usergroupid]!=5$editable=1;
$DB_site->query("UPDATE post SET editable='".$editable."',title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'"); 
test it, i think it should work
Reply With Quote
  #3  
Old 07-02-2002, 04:34 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Am I to asume this is the Query I was to run?

[sql]ALTER TABLE `thelyceu_vbulletin`.`post` ADD `editable` SMALLINT(1) NOT NULL;[/sql]
Our db is called thelyceu_vbulletin...

Satan
Reply With Quote
  #4  
Old 07-02-2002, 04:38 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes except the standart value should be set to 1
Reply With Quote
  #5  
Old 07-02-2002, 04:46 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All seems well...

It just kinda seems to cause weird errors when I add $admineditpost to the Editpost template...

See below :

Satan
Attached Images
File Type: jpg kinda works.jpg (16.6 KB, 0 views)
Reply With Quote
  #6  
Old 07-02-2002, 04:48 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah right...

Changed that...

Satan
Reply With Quote
  #7  
Old 07-02-2002, 04:51 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<tr>
	<td bgcolor="{ firstaltcolor }" nowrap><normalfont><b>Post editable:</b></normalfont></td><td bgcolor="{ firstaltcolor }" nowrap><normalfont>
<input type="radio" name="editable" value="yes"> yes
		<input type="radio" name="editable" value="no">no</normalfont></td>
</tr>
use this as adminedittemplate, and remove the spaces from { firstalt.. }

edit: oh, seen yourself
Reply With Quote
  #8  
Old 07-02-2002, 05:14 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I changed the template there...

Checking to see how it looks

Satan
Reply With Quote
  #9  
Old 07-02-2002, 05:16 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It loots great...

Thanks

Satan
Attached Images
File Type: jpg yey looks nice.jpg (21.1 KB, 0 views)
Reply With Quote
  #10  
Old 07-02-2002, 10:40 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hehe you're welcome

it seems i have talent in posting hacks without even tested them *gg*
Reply With Quote
Reply

Thread Tools
Display Modes

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:12 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.06110 seconds
  • Memory Usage 2,291KB
  • Queries Executed 12 (?)
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
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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
  • (2)postbit_attachment
  • (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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete