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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-13-2007, 08:41 AM
roxxx roxxx is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How grab one post ?

How can I grab one post and display in other site ?

What is question to Mysql to do it ?
Reply With Quote
  #2  
Old 07-13-2007, 09:00 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[sql]SELECT *
FROM `INSERTTABLEPREFIXpost`
WHERE `postid` = INSERTID[/sql]
Make sure you replace the capitalised words.
Reply With Quote
  #3  
Old 07-13-2007, 10:50 AM
roxxx roxxx is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks,

I want to connect to database and I use include("config.php") but what's next ?,
which function to co-operate with it ?
Reply With Quote
  #4  
Old 07-13-2007, 11:03 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by roxxx View Post
thanks,

I want to connect to database and I use include("config.php") but what's next ?,
which function to co-operate with it ?
You dont want to include config.php, you want to include globals.php


then $vbulletin->db is ready to go.
Reply With Quote
  #5  
Old 07-13-2007, 06:16 PM
roxxx roxxx is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok,

so I have:

Code:
<?
require("global.php");
$res = mysql_query("SELECT * FROM post WHERE postid='1111'");
 $row= (mysql_fetch_row($res));
echo ($row[7]);
?>


and it's display this post in other site, but when I want to add new plugin file .php with this code,
forum display error:

Code:
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 311296 bytes) in ............. global.php on line 472
I have limit memory in php.ini 16M.

Is it problem this code or limit ?
Reply With Quote
  #6  
Old 07-13-2007, 11:51 PM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No where near enough information to answer your question, I am afraid.

the php memory limit is settable in php.ini. You wil have to restart apache once you change it.
Reply With Quote
  #7  
Old 07-14-2007, 12:31 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

You shoud be using vb's query functions, not the mysql functions.
Reply With Quote
  #8  
Old 07-14-2007, 06:23 AM
roxxx roxxx is offline
 
Join Date: Jul 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, I should using vb's query functions:
Code:
require("global.php");

$getposts = $db->query_read("
SELECT post.postid AS postid, post.pagetext AS pagetext
FROM " . TABLE_PREFIX . "post AS post
WHERE postid='1111';");
//while($post = $db->fetch_array($getposts))
    $post = $db->fetch_array($getposts);

                    echo "<b>".$post['postid']."</b> - ".$post['pagetext']."<br /><br />";
but is the same error,
is it possible that only choose one post, take that isn't enough memory ?
Reply With Quote
  #9  
Old 07-14-2007, 06:24 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php
$curdir 
getcwd();
chdir('./PATH/TO/FORUMS');
require_once(
'./global.php');
chdir($curdir);

$post $vbulletin->db->query_first("
    SELECT *
    FROM `post`
    WHERE `postid` = 1111
    LIMIT 1
"
);

echo 
$post['message'];
?>
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 10:15 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.08632 seconds
  • Memory Usage 2,243KB
  • 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_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete