Replace actions in profile_cover.html

Hello,

 

in profile_cover.html i found this:

 

<bx_if:show_action_thumbnail>
    <a class="bx-btn bx-btn-small sys-pca-change-background" href="__href_upload_thumbnail__" title="<bx_text_attribute:_sys_btn_thumbnail_change />"> <i class="sys-icon user sys-pca-icon"></i><span class="sys-pca-text" ><bx_text:_sys_btn_thumbnail_change /></span></a>
</bx_if:show_action_thumbnail>

 

I want to replace:

href="__href_upload_thumbnail__"

 

with these function:

return $GLOBALS['oTopMenu']->getScriptFriendAdd({ID}, {member_id});

 

Has anybody an idea or a hint for me, please?

This will be very helpful for me, in order to customize my site.

 

Thank you and a good new year

Thomas

Quote · 3 Jan 2020

As you may know, the html file is not a true html file, it is run though the template engine that parses the file.

__href_upload_thumbnail__   is a key that is replace when the template engine parses the file.  If you do a search on href_upload_thumbnail you should be able to find the code that sets the value of that key.  Keys start and end with two underscores.

Geeks, making the world a better place
Quote · 4 Jan 2020

By the way, you can create and use your own keys in the template files; as I said, you want to denote that it is a template key by starting and ending the key with two underscores.  So  you can create a new key; my_new_key and then to use it in the templates you would insert it as __my_new_key__

Geeks, making the world a better place
Quote · 4 Jan 2020

Dear geek girl,

first of all thank you for your help. Above mentioned statements of you will be very helpful for me. Now, i have some questions and i want to thank you in advantage, because iam sure, that you can help me one more time.

Do you have or is there a list in which all keys are listed, that are available for Dolphin 7.4.

First and foremost, I am concerned with calls for:

- "follow member" and
- "add as friend", here: if the user is already added as a friend, the button "unfriend" should appear instead of "add as friend".

Above mentioned keys should be implemented in the html template "profile_cover.html"

 

Kind regards

Thomas

Quote · 4 Jan 2020

Hello Thomas!

 

This variable is defined in templates/base/scripts/BxBaseProfileGenerator.php file, in the following line:

'href_upload_thumbnail' => $sProfileThumbnailHref


So, you may insert your code there or redefine the complete method showBlockCover in the child class BxTemplProfileGenerator.php

Quote · 4 Jan 2020

Hello Leonid!

 

Thank you for this wonderful help. But where can i find the arrays and variables for the actionbuttons of the profile like befriend or follow.

 

Regards

Thomas

Quote · 5 Jan 2020

Hello Thomas!

 

This actions area depends from the records in the table `sys_objects_actions`. For example, this record is responsible for "Add to friends" button:

 

INSERT INTO `sys_objects_actions` (`Caption`, `Icon`, `Url`, `Script`, `Eval`, `Order`, `Type`, `bDisplayInSubMenuHeader`) VALUES

('{cpt_befriend}', 'plus', '', '{evalResult}', 'return $GLOBALS[''oTopMenu'']->getScriptFriendAdd({ID}, {member_id});', 4, 'Profile', 0),

All variables here like {cpt_befriend}  have been defined in getProfileViewActions method of templates/scripts/BxBaseFunctions.php files. 

{evalResult} means that code willb e replaced from the `Script` column.

Quote · 6 Jan 2020
 
 
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.