The Arcive of vBulletin Modifications Site. |
|
Get postid # in a thread? Details »»
|
|||||||||||||||||||||||||
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
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
[ IMG ] attachment.php?s=&postid=$post[postid][/ IMG ]
|
|
#3
|
|||
|
|||
|
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] |
|
#4
|
||||
|
||||
|
Sorry.
Maybe I miss your meaning. You need edit the every postid=xxx to some acture postid. There xxx is the attach's postid. |
|
#5
|
|||
|
|||
|
Is there any code I can stick in the post that will automatially do that?
|
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
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? |
|
#8
|
||||
|
||||
|
You can try this. In functions.php replace:
Code:
//smilies
if($dosmilies) {
Code:
global $post;
$bbcode = str_replace('{postid}', $post['postid'], $bbcode);
//smilies
if($dosmilies) {
|
|
#9
|
|||
|
|||
|
Thanks FireFly, I'll give that a shot
|
|
#10
|
|||
|
|||
|
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?
|
![]() |
|
|