Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Get postid # in a thread? Details »»
Get postid # in a thread?
Version: , by Ian Cunningham Ian Cunningham is offline
Developer Last Online: Jul 2018 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-27-2002 Last Update: Never Installs: 0
 
No support by the author.

Hi,

I have a news catagory in one of my forums, with about 50% of the posts containing attached images... (see http://www.pcreview.co.uk/showthread...=&threadid=154 for example)

I am currently attaching the image, then editing the post and adding [ IMG ] attachment.php?s=&postid=xxx [/ IMG ] in the post, because I now know the postid #

I cant just tell VB to show the image in the post in the news options, because I need it in various places in the post

Is there any way to modify VB so that I can add a string in a post, and when it is posted, it appears as the attached image?

Thanks, Ian

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-27-2002, 06:44 PM
xware's Avatar
xware xware is offline
 
Join Date: Nov 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[ IMG ] attachment.php?s=&postid=$post[postid][/ IMG ]
Reply With Quote
  #3  
Old 03-27-2002, 06:49 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have just posted a test reply, with that in... but it doesnt work, it shows the URL of the broken image as attachment.php?s=&postid=$post[postid]

So theoretically, just posting $post [postid] should give this thread a number:

$post[postid]
Reply With Quote
  #4  
Old 03-27-2002, 07:05 PM
xware's Avatar
xware xware is offline
 
Join Date: Nov 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry.
Maybe I miss your meaning.
You need edit the every postid=xxx to some acture postid.
There xxx is the attach's postid.
Reply With Quote
  #5  
Old 03-27-2002, 07:32 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any code I can stick in the post that will automatially do that?
Reply With Quote
  #6  
Old 03-27-2002, 07:42 PM
xware's Avatar
xware xware is offline
 
Join Date: Nov 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, I think you can use usercp to change options:
Show image attachments and [img] code in Posts?
set it to yes.
Then the attchimage will display.
Reply With Quote
  #7  
Old 03-27-2002, 07:49 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I do that, I cant select where the image is though?

What I really need is to somehow replace "{postid}" with the actual post ID?
Reply With Quote
  #8  
Old 03-28-2002, 08:12 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can try this. In functions.php replace:
Code:
  //smilies
  if($dosmilies) {
with:
Code:
  global $post;
  $bbcode = str_replace('{postid}', $post['postid'], $bbcode);
  //smilies
  if($dosmilies) {
Reply With Quote
  #9  
Old 03-28-2002, 10:48 AM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks FireFly, I'll give that a shot
Reply With Quote
  #10  
Old 03-28-2002, 12:45 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works! (in part anyway )

When I view the thread with showthread.php it works great! But, I'm mainly viewing it via webnews.php, from the PluhNews script, and it doesnt parse {postid} as a number

I've tried including functions.php, but no success Any Ideas?
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 11:31 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.06979 seconds
  • Memory Usage 2,287KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)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