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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2005, 06:03 PM
rjordan's Avatar
rjordan rjordan is offline
 
Join Date: Sep 2004
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Reading database in editpost.php

Where in EDITPOST.PHP does vB read the post from the database? I cannot seem to locate this.

I am attempting my first "real" PHP hack here, so any help is appreciated!
Reply With Quote
  #2  
Old 01-30-2005, 09:03 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's done on line 71

PHP Code:
$postinfo fetch_postinfo($postid); 
the fetch_postinfo function gains every info out of the db
(it's defined in functions.php for further info)
Reply With Quote
  #3  
Old 01-31-2005, 12:13 AM
rjordan's Avatar
rjordan rjordan is offline
 
Join Date: Sep 2004
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have the following:

editpost.php
PHP Code:
$xyz "Test message";
$xyz handle_bbcode_view_message($xyz); 
functions_bbcodeparse.php
PHP Code:
function handle_bbcode_view_message($code)
{
$postInfo fetch_postinfo($postid);
$code .= $postInfo['post'];
return 
$code;

This is returning nothing other than a single copy of the post. It should return two copies of the same post according to what I (think) I have put together. Any insight into what might be wrong with this?
Reply With Quote
  #4  
Old 01-31-2005, 12:44 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well a quick look suggests you are not passing the postid to the function, so it will fail to find anything ... but what on earth are you trying to do ???
Reply With Quote
  #5  
Old 01-31-2005, 12:55 AM
rjordan's Avatar
rjordan rjordan is offline
 
Join Date: Sep 2004
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

* Modified my post because I pasted the wrong text.

I have a variable assigned the text Test Message. The post I am reading has the same text. I am trying to re-read the original post from the database so I can track post edits. I am 1/2 step away from finishing it, but this and the permission problem I am having (posted earlier today) are stopping me.
Reply With Quote
  #6  
Old 01-31-2005, 01:27 AM
Mink_'s Avatar
Mink_ Mink_ is offline
 
Join Date: Dec 2004
Location: NJ, USA
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't you track edits in the admin cp?
Reply With Quote
  #7  
Old 01-31-2005, 01:30 AM
rjordan's Avatar
rjordan rjordan is offline
 
Join Date: Sep 2004
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I have changed it to the following:

editpost.php
PHP Code:
$xyz "Test message";
$xyz handle_bbcode_view_message($xyz,$post[postid]); 
functions_bbcodeparse.php
PHP Code:
function handle_bbcode_view_message($code,$postid)
{
$postInfo fetch_postinfo($postid);
$code .= $postid.$postInfo['post'];
return 
$code;

Now I get back the value of $post[postid] after my initial phrase (as a test), so the variable is being passed. The message text is still not coming back from the database.

Can you? I have not seen this as an option... if that is the case, then I am going to feel a bit stupid...

I have gone through and do not see an option to turn on edit tracking... where would it be hiding?
Reply With Quote
  #8  
Old 01-31-2005, 01:42 AM
Mink_'s Avatar
Mink_ Mink_ is offline
 
Join Date: Dec 2004
Location: NJ, USA
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could just make a simple SQL query based on that value... Just go into phpyAdmin or whatever you use and look at the database format... the rest should be pretty simple.

And about that option not being in the admin CP... You can see when MODs edit posts at http://www.yoursite.com/forums/admincp/modlog.php...
Reply With Quote
  #9  
Old 01-31-2005, 01:45 AM
rjordan's Avatar
rjordan rjordan is offline
 
Join Date: Sep 2004
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, MySQL... that is something else I need to learn... not really so simple for me at the moment.

Is $postInfo['post'] the correct variable to call based on my code?
Reply With Quote
  #10  
Old 01-31-2005, 01:19 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i think you need

$postInfo['pagetext'] here
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 08:52 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.04194 seconds
  • Memory Usage 2,256KB
  • Queries Executed 13 (?)
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
  • (5)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
  • (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_postinfo_query
  • fetch_postinfo
  • 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