1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Build Link

Discussion in 'XenForo Development Discussions' started by PhpMember, Sep 6, 2011.

  1. PhpMember

    PhpMember Member

  2. James

    James Well-Known Member

    Look at XenForo_Route_Prefix_Members:
    public function match($routePathZend_Controller_Request_Http $requestXenForo_Router $router)
    $action $router->resolveActionWithIntegerParam($routePath$request'user_id');
    You need to use resolveActionWithIntegerParam for the item.id

    As for the action, you should be able to specify actionViewImage() inside your chosen ControllerPublic (see getRouteMatch)
  3. ragtek

    ragtek Guest

    Is it for the existing useralbums add-on?
    If there are all necessary data in $image, you can use:

    {xen:link useralbums/view-image, $image}

    Check XfRu_UserAlbums_Route_Prefix_UserAlbums ;) and not that what james requested...
  4. Digital Doctor

    Digital Doctor Well-Known Member

  5. PhpMember

    PhpMember Member

    Some urls weren't working on the useralbums addons

    I made a few modifications to fix them, to the albums addon to allow albums owner's info when someone posts a new image, and the link wasn't working because it needed some missing image data:

    newsfeed $item
    $item['content']['image_id'] = $item['content']['last_image_id'];

    $item['content']['filename'] = $item['content']['last_image_filename'];

    $item['content']['image_date'] = $item['content']['last_image_date'];
    ^^ the above fixes the image links

    username+user_id of the album's owner was missing when posting a new comments on images

    ^^ the above also for the album owner be mentioned on the news feed

    newsfeed $item
    $extra unserialize($item['extra_data']);

    $item['album_owner'] = $extra['album_owner'];

    $item['thumbnail'] = $extra['thumbnail'];
    to pick the info of the album's owner, so that it can be also submitted to the serialized array $extra on the newsfeed

    //XfRu_UserAlbums_ControllerPublic_Comments::actionImageAddComment(): 29

    $imagesModel $this->getImagesModel();

    $image $imagesModel->getImageById($imageId);

    $albumHash $this->_input->filterSingle('access_hash'XenForo_Input::STRING);

    $albumsModel $this->getAlbumsModel();

    try {

    $album $albumsModel->assertAlbumValidAndViewable($image['album_id'], $albumHash);

    } catch (
    Exception $e) {



    $thumbnailUrl $imagesModel->getImageThumbnailUrl(array('data_id' => $image['data_id'], 'file_hash' => $image['file_hash']));

    ^^ the above allows for the $album and $image data to be submitted to the newsfeed so that it can be used for additional, stuff like showing thumbnail

    Publishing the info to the newsfeed

    'owner_name'=> $album['username'],'owner_id'=> $album['user_id'],'thumbnail'=> $thumbnailUrl/**ADDED**/

    case 'comment':
    //XfRu_UserAlbums_Model_NewsFeed::publishFeedItem(): 52








    'album_owner' =>


    'username'=> $data['owner_name'],

    'user_id'=> $data['owner_id']


    'thumbnail'=> $data['thumbnail']




    ^^ the above is just the second part that complements the part above
  6. ragtek

    ragtek Guest

    pls youse php code tags!:p
    PhpMember likes this.

Share This Page