Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-23-2006, 02:51 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default show postid in post

I am using a data manager to send text to a post.
Is there a code that will show the postid of the post it's on?

I already tried $post[postid]

In theory this is how the link is supposed to be

hosting.php?do=accept&postid=880058&userid=82213
Reply With Quote
  #2  
Old 01-23-2006, 02:54 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by harmor19
I am using a data manager to send text to a post.
Is there a code that will show the postid of the post it's on?

I already tried $post[postid]
why not just edit the postbit template?

if you are doing it inside of files

$vbulletin->post['postid']
Reply With Quote
  #3  
Old 01-23-2006, 02:56 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess when in doubt use $vbulletin->


Edit:
It didn't work.
Reply With Quote
  #4  
Old 01-23-2006, 03:16 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by harmor19
I guess when in doubt use $vbulletin->


Edit:
It didn't work.
Ok, how about some more info?

The postid is already inside of the postbit template, what exactly are you trying to do, and how?
Reply With Quote
  #5  
Old 01-23-2006, 10:21 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is part of the data manager that I have in my hack

PHP Code:
$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);

    
$postthreadid $ht['host_thread'];
    
$postuserid $vbulletin->userinfo['userid'];
    
$postpagetext "[b]Upgrade Hosting[/b]\n
                     [b]Subdomain:[/b] "
.$_POST['subdomain'].".iconrate.net\n
                     [b]Username:[/b] "
.$_POST['susername']."\n
                     [b]Password:[/b] 
$pass\n
                     [b]Plan:[/b] "
.$hp['title']."
                     \n\n
                     [url=\""
.$vbulletin->options['bburl']."/hosting.php?do=accept&postid=".$vbulletin->post['postid']."&postuserid=".$vbulletin->userinfo[userid]."\"]Accept[/url] | [url=\"".$vbulletin->options['bburl']."/hosting.php?do=decline&postid=".$vbulletin->post['postid']."&postuserid=".$vbulletin->userinfo[userid]."\"]Decline[/url]"
In the two links I have "postid=".$vbulletin->post['postid']."

I want to do this because when I click the link I want to automatically edit the post.
Reply With Quote
  #6  
Old 01-23-2006, 10:56 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you want to have the postid of the post you are going to create, it is not there until after the post is made.
Reply With Quote
  #7  
Old 01-23-2006, 06:56 PM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tell me if the following will cause conflict if I have a large userbase.

Before I process the post data manager I get the last postid
PHP Code:
$getpost $db->query_read("SELECT * FROM " TABLE_PREFIX "post WHERE postid ORDER by postid DESC ");
    
$post $db->fetch_array($getpost); 
Then I add one to it.
PHP Code:
$postid $post['postid'] + 1
Reply With Quote
  #8  
Old 01-23-2006, 07:13 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well what you try is selecting all posts, so yes that would put a high load on the server. If you really want it like this then use the following:
PHP Code:
 $post $db->query_read("SELECT * FROM " TABLE_PREFIX "post ORDER BY postid DESC LIMIT 1"); 
But this would be very unaccurate, and likely to fail regular, since another post could have been made in this time.

I still don't understand why you want to create a post that contains the postid of the post itself.
Reply With Quote
  #9  
Old 01-23-2006, 07:24 PM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The reason why I want the postid in the post is because I have two links.
When I click the link I want to automatically edit the post and remove the two links and replace them with the respected text.
Reply With Quote
  #10  
Old 01-23-2006, 07:29 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not just a link in the postbit when displaying the post?
Reply With Quote
Reply

Thread Tools
Display Modes

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 04:09 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.04557 seconds
  • Memory Usage 2,263KB
  • 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
  • (4)bbcode_php
  • (2)bbcode_quote
  • (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