Action block

Hello,

 

How can i add a button to action block as php?

Quote · 29 Jan 2013

Either by hand in the database table sys_objects_actions rather complex depending on what the action button is to do, who it is to be displayed to, ect. Which you did not mention.

or with this mod. http://www.boonex.com/m/actions-manager-premium

https://www.deanbassett.com
Quote · 29 Jan 2013

 

Either by hand in the database table sys_objects_actions rather complex depending on what the action button is to do, who it is to be displayed to, ect. Which you did not mention.

or with this mod. http://www.boonex.com/m/actions-manager-premium

 I found it in sql but how can i add the report button from Profile actions block to ProfileTitle?

 I've tried adding like this, but it did not:

Caption: {cpt_report}

Icon: exclamation-sign

Script: {evalResult}

Eval: if ({ID} == {member_id}) return;


return  "$.post('list_pop.php?action=spam', { ID: '{ID}' }, function(sData){ $('#ajaxy_popup_result_div_{ID}').html(sData) } );return false;";

Order: 4
Type: ProfileTitle
bDisplayInSubMenuHeader: 1
Quote · 29 Jan 2013

 

 I found it in sql but how can i add the report button from Profile actions block to ProfileTitle?
 I've tried adding like this, but it did not:
Caption: {cpt_report}
Icon: exclamation-sign
Script: {evalResult}
Eval: if ({ID} == {member_id}) return;

return  "$.post('list_pop.php?action=spam', { ID: '{ID}' }, function(sData){ $('#ajaxy_popup_result_div_{ID}').html(sData) } );return false;";
Order: 4
Type: ProfileTitle
bDisplayInSubMenuHeader: 1

 

Quote · 30 Jan 2013

And your result was what?

You did clear the dolphin cache after correct?

https://www.deanbassett.com
Quote · 30 Jan 2013

 Yes, but i'm not quite sure. I try it again. Do you think is right?

And your result was what?

You did clear the dolphin cache after correct?

 

Quote · 30 Jan 2013

 

 Yes, but i'm not quite sure. I try it again. Do you think is right?

And your result was what?

You did clear the dolphin cache after correct?

 

Yes it looks right. I just did it the easy way in phpmyadmin for my site which was to edit the existing. Change profile to profile title and remove the id then insert as new row instead of saving which makes a duplicate of it. And it showed up after clearing the cache. Which is normal for manual database changes. You always have to clear the cache.

You will have a caption problem tho. the {cpt_report} caption item is not processed in the title section.

https://www.deanbassett.com
Quote · 30 Jan 2013

Yes just like you said:

 

 

 

 Yes, but i'm not quite sure. I try it again. Do you think is right?

And your result was what?

You did clear the dolphin cache after correct?

 

Yes it looks right. I just did it the easy way in phpmyadmin for my site with was to edit the existing. Change profile to profile title and remove the id then insert as new row which makes a duplicate of it. And it showed up after clearing the cache. Which is normal for manual database changes. You always have to clear the cache.

You will have a caption problem tho. the {cpt_report} caption item is not processed in the title section.

 

profile.png · 15.6K · 582 views
Quote · 30 Jan 2013

Now you have two choices.

1) Edit the entry and change {cpt_report} to Report Spam

or

2) Edit profile.php and look for this

if(isFriendRequest($iMemberId, $iId)) {

And insert this just before it.

$aVars['cpt_report'] = _t('_Report Spam');


The simple way would be choice 1

https://www.deanbassett.com
Quote · 30 Jan 2013

 Im sing Dolphin with multi language and I have a little php knowledge .

I'm trying the second choice.

2) Edit profile.php and look for this

if(isFriendRequest($iMemberId, $iId)) {

And insert this just before it.

$aVars['cpt_report'] = _t('_Report Spam');


The simple way would be choice 1

 

Quote · 30 Jan 2013

I added it but now dashboard button not showing on profile page can you provide it to me please?

Quote · 31 Jan 2013

I did not actually test that part, so let me test and i will get back to you. I may need to do something different.

So undo that file change until i get back to you.

https://www.deanbassett.com
Quote · 31 Jan 2013

I tested it, and it worked fine.

I have a feeling you did not insert as new row in the database and actually over wrote the original.

Check your database entry to make sure the original {cpt_report} for the profile is there.

https://www.deanbassett.com
Quote · 31 Jan 2013

It worked fine from me too, but i need dashboard button row. I do not know why, but after added them its not showing..

Can you provide me the row?

-And ya it's still there ..

Quote · 31 Jan 2013

Your going to have to provide me with screen shots.

Your origional request was for a button on the profile page in the profile title area. And this does that. And the pic you provided shows it where this was to place it. So you now have me lost because i do not know what you want or what your asking for anymore. I thought i provided what you wanted.

The dashboard your talking about does not exist on the profile page.

So i am not following your request.

https://www.deanbassett.com
Quote · 31 Jan 2013

I added profile edit and subscribe to own profile title area. its showing there is no problem with them, but before adding them there was dashboard button from own profile title area, but there are not anymore dashboard button on my own profile..

 

Naamloos.png · 127K · 593 views
Quote · 31 Jan 2013

Ok. So this is unrelated to what we just did.

I don't know. I have not added either of those two items.

I still have the My Account(dashboard) button on my own profile. SO what we did here was not what caused it to disappear or i would also have lost mine. But mine is still there.

1-30-2013 8-46-44 PM.png · 166.4K · 497 views
https://www.deanbassett.com
Quote · 31 Jan 2013

This items caption for that button is {cpt_am_profile_account_page}

This would be the query to put it back in if it is missing.

INSERT INTO `sys_objects_actions` (`ID`, `Caption`, `Icon`, `Url`, `Script`, `Eval`, `Order`, `Type`, `bDisplayInSubMenuHeader`) VALUES (NULL, '{cpt_am_profile_account_page}', 'dashboard', '{evalResult}', '', 'return $GLOBALS[''oTopMenu'']->getUrlAccountPage({ID});', '5', 'ProfileTitle', '1');

https://www.deanbassett.com
Quote · 31 Jan 2013

Thanks its done. but subscribe dont work.

Why do you think could be?

Quote · 31 Jan 2013

 

Thanks its done. but subscribe dont work.

Why do you think could be?

Most likely because it requires supporting code and a return area to display the message that's returned after it's done.

It was not designed to be placed in the title area.




https://www.deanbassett.com
Quote · 31 Jan 2013

 Its not able to fix?

Most likely because it requires supporting code and a return area to display the message that's returned after it's done.

It was not designed to be placed in the title area.

 

Quote · 31 Jan 2013

Try this. I have not tested it.

To get the subscribe button working this will have to be added to profile.php. Just under the last line you added.

//--- Subscription integration ---//

$oSubscription = new BxDolSubscription();
$sAddon = $oSubscription->getData();

$aButton = $oSubscription->getButton($iMemberID, 'profile', '', $profileID);
$aVars['sbs_profile_title'] = $aButton['title'];
$aVars['sbs_profile_script'] = $aButton['script'];
//--- Subscription integration ---//

Then at the top of profile.php just under bx_import('BxDolInstallerUtils');

Insert this.

bx_import('BxDolSubscription');

Not all buttons can be blindly copied or moved to where they were not designed to be.

https://www.deanbassett.com
Quote · 31 Jan 2013

This is not likely to work tho. I believe there is more code and i am not sure of the rest of it.

https://www.deanbassett.com
Quote · 31 Jan 2013

I removed it because It showing for the guests too and some of them is not working properly..

Thanks for your help i learned some things.

Quote · 31 Jan 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.