vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Reading database in editpost.php (https://vborg.vbsupport.ru/showthread.php?t=75435)

rjordan 01-30-2005 06:03 PM

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!

Xenon 01-30-2005 09:03 PM

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)

rjordan 01-31-2005 12:13 AM

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?

Paul M 01-31-2005 12:44 AM

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 ???

rjordan 01-31-2005 12:55 AM

* 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.

Mink_ 01-31-2005 01:27 AM

Can't you track edits in the admin cp?

rjordan 01-31-2005 01:30 AM

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?

Mink_ 01-31-2005 01:42 AM

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...

rjordan 01-31-2005 01:45 AM

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?

Xenon 01-31-2005 01:19 PM

i think you need

$postInfo['pagetext'] here :)


All times are GMT. The time now is 05:54 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.01208 seconds
  • Memory Usage 1,736KB
  • 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
  • (5)bbcode_php_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