MyBB Community Forums

Full Version: How to write this?!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have a question about this plugin. but I don't understand the coding language. Please help

main question:
Quote:if I am not the owner of the post, the link will display the URL (PID) to the donation  ---> newpoints.php?action=donate
if I am the owner of the post, the link will display the URL (PID) to the newpoints ---> newpoints.php

IF NOT my POST url (PID) link will appear here. IF my POST the url (PID) will show

and this, is my code. however, it didn't go as I expected

{$post['username']} Koin: 
<if $post['uid'] then>
<a href="{$mybb->asset_url}/newpoints.php?action=donate&amp;uid={$post['uid']}">{$post['newpoints']}</a>
<else>
<a href="{$mybb->asset_url}/newpoints.php">{$post['newpoints']}</a>
</if>
<br />

NOTE:
Quote:the template i edited, is postbit_author_user


Sorry for my incomprehensible English  Blush
I want to display the following info on the member's profile.
https://community.mybb.com/attachment.php?aid=45085

under the condition:
if I am not the owner of the post, the link will display the URL (PID) to the donation  ---> newpoints.php?action=donate
https://community.mybb.com/attachment.php?aid=45084

if I am the owner of the post, the link will display the URL (PID) to the newpoints ---> newpoints.php
https://community.mybb.com/attachment.php?aid=45083

is there no one who can help?
somebody, please help me
BUMP...
BUMP...
BUMP...
I'm pretty sure you'll want to edit the template: Global Template / newpoints_postbit

I've tried a few variations, but I can't quite get the right if/else combination to work. Hopefully this helps in some way, though?

<if $post['uid'] then>
	<a href="{$mybb->settings['bburl']}/newpoints.php">{$points}</a>
	<else>
<a href="{$mybb->asset_url}/newpoints.php?action=donate&amp;uid={$post['uid']}">{$points}</a>
</if>
I have tried before with such code. not work!.  Confused

still need answer to solve this problem  Undecided
BUMP...
O do not know too much about newpoints due i only was made some customizations for clients.

But it need to add yor desired link into the plugins hook, and call it into template by replacing in the way you need. So you will need to add two small modifications and you're done Smile

The way is by taking the hook and add your two possible urls and then make a case for user id within the member profile id that is very easy to do so only you will need to take a few minutes to do it Smile
Pages: 1 2