Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Which file to edit > my profile > discussions

422422 Developer MVP
edited February 2013 in Vanilla 2.0 - 2.8

I am on .....forums/profile/discussions/1/steve

I want to edit the code for spewing out discussions, on this page. Buggered if i can find where it is controlled from

body id is > dashboard_profile_discussions

There was an error rendering this rich post.

Comments

  • Options
    businessdadbusinessdad Stealth contributor MVP
    edited February 2013

    You're lucky, I changed it just yesterday. The file is views/discussions/discussions.php.

    To implement the theme required by my client, I had to override over a dozen of views from core, plugins and so on, so I know the pain of finding out what displays what.

  • Options
    422422 Developer MVP

    Yer that much I know, its the particular hook for the ( profile discussion block that has me stumped )

    There was an error rendering this rich post.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    @422 I'm not sure I understand what you mean. The discussions are rendered in the Profile page using the same file I indicated above. The view is included by views/profile/index.php based on the selected tab.

  • Options
    422422 Developer MVP

    Hmm, Ok well I have modded that page already, and renders perfect in every derivative except, the profile > discussions block. So not sure theres anything else I can do, aside from showing you a screeny will do so now.

    2 images, one shows the index page discussions ( modded to show image of post author and latest comment user )

    in the second image in the users profile / discussions block, the original authors avatar ( code not even present ) is not displayed, and I am buggered if I can see where it needs to be amended.

    I dont mind sharing that particular pages php if that helps

    There was an error rendering this rich post.

  • Options
    422422 Developer MVP

    Oh and FFS isnt it about time they added lightboxes to images on this bloody forum ( annoys the crap out of me especially when its so EASY to do )

    There was an error rendering this rich post.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    @422 said:

    in the second image in the users profile / discussions block, the original authors avatar ( code not even present ) is not displayed, and I am buggered if I can see where it needs to be amended.

    I'm quite sure that the discussions.php is the file to change. Perhaps it's a rendering issue. Have you tried putting some echo(), or even a die() statement, to double check if that file is the one loaded?

  • Options
    422422 Developer MVP
    edited February 2013

    You sure its discussions > discussions ?

    I had amended php in views>discussions>helper_functions.php lol

    The content of discussions>discussions.php is:

    <?php if (!defined('APPLICATION')) exit();
    $Session = Gdn::Session();
    if (!function_exists('WriteDiscussion'))
       include($this->FetchViewLocation('helper_functions', 'discussions', 'vanilla'));
    
        
    $Alt = '';
    if (property_exists($this, 'AnnounceData') && is_object($this->AnnounceData)) {
        foreach ($this->AnnounceData->Result() as $Discussion) {
            $Alt = $Alt == ' Alt' ? '' : ' Alt';
            WriteDiscussion($Discussion, $this, $Session, $Alt);
        }
    }
    
    $Alt = '';
    foreach ($this->DiscussionData->Result() as $Discussion) {
       $Alt = $Alt == ' Alt' ? '' : ' Alt';
       WriteDiscussion($Discussion, $this, $Session, $Alt);
    }
    

    There was an error rendering this rich post.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    I'm quite sure that views/discussions/discussions.php is the one that's called. I changed it and I saw the change in the profile page as well. If you need to fine tune the way the single discussion entry is rendered, then you have to modify views/discussions/helper_functions.php as well.

    It's a bit messy, I know...

  • Options
    422422 Developer MVP

    Ok I fixed it. Because we use Lincolns Index Photos plugin, i created a new function.

    /**
        * Trigger on Profile Discussions.
        */
       public function ProfileController_BeforeDiscussionContent_Handler($Sender) {
          $this->DisplayPhoto($Sender);
       }
    

    There was an error rendering this rich post.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    Glad you got it sorted. Navigating through the views in the views in the views (...) can be quite daunting, sometimes. :)

  • Options
    422422 Developer MVP

    @businessdad said:
    Glad you got it sorted. Navigating through the views in the views in the views (...) can be quite daunting, sometimes. :)

    Not so much daunting as a complete pain in the ass lol

    There was an error rendering this rich post.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    @422 said:
    Not so much daunting as a complete pain in the ass lol

    I tried to be moderate. :D

  • Options

    @422 said:
    isnt it about time they added lightboxes to images on this bloody forum

    Issue added on gitHub : https://github.com/vanillaforums/Garden/issues/1525

    Please add your comments on which lightbox script to use etc, on gitHub.

    There was an error rendering this rich post.

  • Options
    422422 Developer MVP

    Cheers ( added to github )

    There was an error rendering this rich post.

Sign In or Register to comment.