Thread: mYvBindex v3.1
View Single Post
  #305  
Old 12-28-2002, 04:02 AM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok MartyJ, here's at least half of what you wanted.
To make it so that you can make a news post in any forum:

You will need to run these queries in phpMyAdmin before uploading your changed files:
ALTER TABLE post DROP `isnews`;

Then this query:
ALTER TABLE post ADD isnews char(1) NOT NULL DEFAULT 'N';

Note that after you run those queries no news posts will be visible on your myvbindex page. This is necessary since you are in a sense completely changing the way the news part works.


Create a new template called newthread_newsopt with the following content:
PHP Code:
<br><input type="checkbox" name="isnews" value="Y"> <b>Make News:</bMake this post news
Then edit your newthread template and look for:
PHP Code:
<input type="checkbox" name="signature" value="yes" $signaturechecked> <b>Show Signature:</b> include your profile signature.  Only registered users may have signatures
Right Below that Add:
PHP Code:
$newsoption 
Edit your editpost template and find:
PHP Code:
<input type="checkbox" name="signature" $signaturechecked value="yes"> <b>Show Signature:</b> include your profile signature.  Only registered users may have signatures
Right Below that Add:
PHP Code:
$newsoption 

Open myvbindex.php and find:
PHP Code:
WHERE thread.forumid=$newsforum AND isnews='Y' GROUP BY thread.threadid ORDER BY thread.threadid DESC $newsmax"); 
Replace that with:
PHP Code:
WHERE isnews='Y' GROUP BY thread.threadid ORDER BY thread.threadid DESC $newsmax"); 
Then open your newthread.php file and look for:
PHP Code:
'$ipaddress','$iconid','1','Y')"); 
Replace that with:
PHP Code:
'$ipaddress','$iconid','1','$isnews')"); 
Still in newthread.php, find:
PHP Code:
  if ($permissions[canpostattachment] and (!$safeupload or function_exists("is_uploaded_file"))) {
    eval(
"\$attachmentoption = \"".gettemplate("newpost_attachment")."\";");
  } else {
    
$attachmentoption="";
  } 
Above that Add:
PHP Code:
$newsoption '';
if (
in_array($bbuserinfo['usergroupid'], array(56))){
eval(
"\$newsoption .= \"".gettemplate('newthread_newsopt')."\";");


Open your editpost.php file and look for:
PHP Code:
  $editattachment '';
  if (
$postinfo[attachmentid]!=and (!$safeupload or function_exists("is_uploaded_file"))) {
    
// show edit attachment options
    // keep, delete, new upload
    
$attachmentinfo=$DB_site->query_first("SELECT filename FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
    
$postinfo[filename] = htmlspecialchars($attachmentinfo['filename']); 
Above that Add:
PHP Code:
  $newsoption '';
if (
in_array($bbuserinfo['usergroupid'], array(56))){
eval(
"\$newsoption .= \"".gettemplate('newthread_newsopt')."\";");

Still in editpost.php, 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'"); 
Replace that with:
PHP Code:
  $DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid',isnews='$isnews'$editedbysql$attachmentsql WHERE postid='$postid'"); 

Upload the changed files and make sure you have ran the queries in phpMyAdmin. Now admins for your board will see an extra check box right under "Show Signature" with the option to make the thread news. If you don't want this option to be available to all admins let me know and I can tell you how to change who will see the option.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01319 seconds
  • Memory Usage 1,832KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (15)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete