Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 02-28-2009, 07:43 AM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I try to put something into postbit_display_start, like, say
Code:
echo "this is a test statement";
What happens is, it gets put at the top of the page before the doctype declaration. I'm kind of stumbling around in the dark here.

--------------- Added [DATE]1235820573[/DATE] at [TIME]1235820573[/TIME] ---------------

Okay...
I wrote this plugin:

Postdata_start
Code:
if ($post[field11] && $post[field12])
{
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$parsed_text = $parser->do_parse($text, $do_html, $do_smilies, $do_bbcode, $do_imgcode, $do_nl2br, $cachable);  

$text = $post[field11].$message.$post[field12];
}
And this in postbit_legacy:
Code:
<if condition="$post[field11] AND $post[field12]">$parsed_text
		<else />	$post[message]</if>
(replaces $post[message])

But when I tried it out, no HTML was outputted. And this is probably a serious security risk, seeing as people can type in PHP code for the fields and have it execute. How can I change that?
Reply With Quote
  #12  
Old 02-28-2009, 11:07 AM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

one way to find out where to execute your code is to look in tje php files themselves. for instance, showthread.php for stuff dealing with posts.

If you look through the code you will see the hook locations. Basically you can find out what hook is being called where. Once you know where it is being called in the code, you can go back to your plugin manager and write your code for the hook that will execute where you want it to.

for instance, on line 1078 of showthread.php i see
[code]
($hook = vBulletinHook::fetch_hook('showthread_postbit_crea te')) ? eval($hook) : false;
[/hide]

so if i were to make a plugin inside that hook it know it will be executed when that hook is called in the php file.

I dont really know if its the best way to find out which hook is t he right one for your needs, but it works for me quite often
Reply With Quote
  #13  
Old 02-28-2009, 09:59 PM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Come on... Can't anyone help me out here?
Reply With Quote
  #14  
Old 03-02-2009, 04:49 PM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which file processes the form from replies? Which actual PHP file in vBulletin?
Reply With Quote
  #15  
Old 03-02-2009, 04:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Go to the page and look in the page source. You will find some line like this (this is from somewhere else, it's not it):

HTML Code:
<form action="newthread.php?do=postthread&amp;f=11" method="post" name="vbform" onsubmit="return vB_Editor['vB_Editor_001'].prepare_submit(this.subject.value, 5)">
That tells you the form and do value that will be submitted.
Reply With Quote
  #16  
Old 03-03-2009, 06:16 PM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One final question, and then I think I'll FINALLY have this stupid issue! (Breakthrough was reached by just scanning all the files that seemed relevant for a comment telling me about "this is where we process posts).
What I did was this:

In file: functions_newpost.php

Find:
PHP Code:
    $post['emailupdate'] = intval($post['emailupdate']);
    
$post['rating'] = intval($post['rating']);
    
$post['podcastsize'] = intval($post['podcastsize']); 
Add under:

PHP Code:
    $post['message'] = "<stuff>" .$post['message']. "<stuff>"
And if you put bbcode in there... it will parse! Hallelujah!

As to my questions...

1. Will a variable that works well in the template (in this case, the aforementioned field variables) work as they are there in the files? Like say I put this string in functions_newpost.php (where I put the last string I mentioned):

PHP Code:
    $post['message'] = $post['field11'].$post['message'].$post['field12']; 
How can I make that work in the file itself?
Reply With Quote
  #17  
Old 03-05-2009, 03:41 AM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump?
Reply With Quote
  #18  
Old 03-05-2009, 04:51 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are talking about the build_new_post() function, no, it will not work.
  1. User info is not available there.
  2. If it did exist, when the user changes the field, it will not be reflected in their posts.
Reply With Quote
  #19  
Old 03-05-2009, 10:47 AM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

GAAAAAAAAAAAAAAAH

So it's also impossible to get the info to there? How about setting a plugin that way? The guys over at MTGSalvation and MTGNews figured it out somehow!

Sorry if I sound a little hysterical; I am.
Reply With Quote
  #20  
Old 03-05-2009, 11:19 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

postbit_display_complete
Reply With Quote
Reply


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:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06856 seconds
  • Memory Usage 2,266KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_code
  • (1)bbcode_html
  • (3)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
  • (2)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
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete