Jump to content

Larger Avatars for Posts Compatible with 4.1 & 4.2


John

Recommended Posts

revamped the whole code, with the new changes

  • it should be easier to implement
  • less cluster
  • should work on all versions of ipboard 4 even 4.2

P.S. it is recommended everyone update their code with the instructions in the first post of this thread

Edited by John
Link to comment
Share on other sites

@Frenvius thanks for bringing it to my attention the fix is here just replace the entire code in "userPhoto2" that you created

 

{{if $member->member_id and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
{{$memberURL = ( $warningRef ) ? $member->url()->setQueryString( 'wr', $warningRef ) : $member->url();}}
	<a href="{$memberURL}" {{if $hovercard}}data-ipsHover data-ipsHover-target="{$memberURL->setQueryString( 'do', 'hovercard' )}"{{endif}} class="ipsUserPhoto ipsUserPhoto_{$size}{{if $classes}} {$classes}{{endif}}" title="{lang="view_user_profile" sprintf="$member->name"}">
		<img src='{{if $member->pp_main_photo}}{file="$member->pp_main_photo"}{{else}}{file="$member->photo"}{{endif}}' alt='{$member->name}'>
	</a>
{{else}}
	<span class='ipsUserPhoto ipsUserPhoto_{$size} {{if $classes}}{$classes}{{endif}}'>
		<img src='{file="$member->photo"}' alt='{$member->name}'>
	</span>
{{endif}}

 

Edited by John
  • Upvote 1
Link to comment
Share on other sites

  • 2 months later...
On 6/1/2017 at 12:57 AM, John said:

@Frenvius thanks for bringing it to my attention the fix is here just replace the entire code in "userPhoto2" that you created

 


{{if $member->member_id and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
{{$memberURL = ( $warningRef ) ? $member->url()->setQueryString( 'wr', $warningRef ) : $member->url();}}
	<a href="{$memberURL}" {{if $hovercard}}data-ipsHover data-ipsHover-target="{$memberURL->setQueryString( 'do', 'hovercard' )}"{{endif}} class="ipsUserPhoto ipsUserPhoto_{$size}{{if $classes}} {$classes}{{endif}}" title="{lang="view_user_profile" sprintf="$member->name"}">
		<img src='{{if $member->pp_main_photo}}{file="$member->pp_main_photo"}{{else}}{file="$member->photo"}{{endif}}' alt='{$member->name}'>
	</a>
{{else}}
	<span class='ipsUserPhoto ipsUserPhoto_{$size} {{if $classes}}{$classes}{{endif}}'>
		<img src='{file="$member->photo"}' alt='{$member->name}'>
	</span>
{{endif}}

 

Man it doesn't work with Veizor 1.0.1 for ips 4.2

It doesn't change anything. I wanted to have width 150px and height 300px 

Could you please telll how to edit it?

Thank you in advance. :)

Link to comment
Share on other sites

10 hours ago, iGreen said:

Man it doesn't work with Veizor 1.0.1 for ips 4.2

It doesn't change anything. I wanted to have width 150px and height 300px 

Could you please telll how to edit it?

Thank you in advance. :)

 

did u by chance try following instructions on the first page of this thread? just checked it out and edit is working fine for the theme

 

also make sure that it is not the <div class="cAuthorPane_photo"> u are changing to userphoto2 and <li class="cAuthorPane"> instead cause that one in postContainer is for the mobile version of your forum and not the main forum version

Edited by John
  • Upvote 1
Link to comment
Share on other sites

i did it this way and it worked:

change code fromTemplates/core/front/global/userPhoto with this one:

{{if $member->member_id and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) )}}
{{$memberURL = ( $warningRef ) ? $member->url()->setQueryString( 'wr', $warningRef ) : $member->url();}}
    <a href="{$memberURL}" {{if $hovercard}}data-ipsHover data-ipsHover-target="{$memberURL->setQueryString( 'do', 'hovercard' )}"{{endif}} class="ipsUserPhoto ipsUserPhoto_{$size}{{if $classes}} {$classes}{{endif}}" title="{lang="view_user_profile" sprintf="$member->name"}">
        <img src='{$member->photo}' alt='{$member->name}' itemprop="image">
    </a>
{{else}}
    <span class='ipsUserPhoto ipsUserPhoto_{$size} {{if $classes}}{$classes}{{endif}}'>
        <img src='{$member->photo}' alt='{$member->name}' itemprop="image">
    </span>
{{endif}}

Then go to Templates/forums/front/topics/postContainer and change the whole code with this one:

{{$idField = $comment::$databaseColumnId;}}
{{$itemClassSafe = str_replace( '\\', '_', mb_substr( $comment::$itemClass, 4 ) );}}
{{if $comment->isIgnored()}}
    <div class='ipsComment ipsComment_ignored ipsType_light' id='elIgnoreComment_{$comment->$idField}' data-ignoreCommentID='elComment_{$comment->$idField}' data-ignoreUserID='{$comment->author()->member_id}'>
        {lang="ignoring_content" sprintf="$comment->author()->name"} <a href='#elIgnoreComment_{$comment->$idField}_menu' data-ipsMenu data-ipsMenu-menuID='elIgnoreComment_{$comment->$idField}_menu' data-ipsMenu-appendTo='#elIgnoreComment_{$comment->$idField}' data-action="ignoreOptions" title='{lang="see_post_ignore_options"}' class='ipsType_blendLinks'>{lang="options"} <i class='fa fa-caret-down'></i></a>
        <ul class='ipsMenu ipsHide' id='elIgnoreComment_{$comment->$idField}_menu'>
            <li class='ipsMenu_item ipsJS_show' data-ipsMenuValue='showPost'><a href='#'>{lang="show_this_post"}</a></li>
            <li class='ipsMenu_sep ipsJS_show'><hr></li>
            <li class='ipsMenu_item' data-ipsMenuValue='stopIgnoring'><a href='{url="app=core&module=system&controller=ignore&do=remove&id={$comment->author()->member_id}" seoTemplate="ignore"}'>{lang="stop_ignoring_posts_by" sprintf="$comment->author()->name"}</a></li>
            <li class='ipsMenu_item'><a href='{url="app=core&module=members&controller=ignore" seoTemplate="ignore"}'>{lang="change_ignore_preferences"}</a></li>
        </ul>
    </div>
{{endif}}

<a id='comment-{$comment->$idField}'></a>
<article itemscope {{if $item->isQuestion() && !$comment->new_topic}}itemprop="suggestedAnswer {{if $comment->post_bwoptions['best_answer']}}acceptedAnswer{{endif}}" itemtype="http://schema.org/Answer"{{else}}itemtype="http://schema.org/Comment"{{endif}} id='elComment_{$comment->$idField}' class='cPost ipsBox {{if $otherClasses}}{$otherClasses}{{endif}} ipsComment {{if settings.reputation_highlight and $comment->reputation() >= settings.reputation_highlight}}ipsComment_popular{{endif}} ipsComment_parent ipsClearfix ipsClear ipsColumns ipsColumns_noSpacing ipsColumns_collapsePhone {{if $comment->isIgnored()}}ipsHide{{endif}} {{if $comment->hidden()}}ipsModerated{{endif}}'>
    {{if $item->isQuestion() and !$comment->new_topic}}
        {template="postRating" group="topics" app="forums" params="$item, $comment, $votes"}
    {{endif}}
    <aside class='ipsComment_author cAuthorPane ipsColumn ipsColumn_medium'>
        <h3 class='ipsType_sectionHead cAuthorPane_author ipsType_blendLinks ipsType_break' itemprop="creator" itemscope itemtype="http://schema.org/Person"><strong itemprop="name">{$comment->author()->link( $comment->warningRef() )|raw}</strong> <span class='ipsResponsive_showPhone ipsResponsive_inline'>&nbsp;&nbsp;{template="reputationBadge" group="global" app="core" params="$comment->author()"}</span></h3>
        <ul class='cAuthorPane_info ipsList_reset'>
            {{if $comment->author()->member_title && $comment->author()->member_id}}
                <li class='ipsResponsive_hidePhone ipsType_break'>{$comment->author()->member_title}</li>
            {{elseif $comment->author()->rank['title'] && $comment->author()->member_id}}
                <li class='ipsResponsive_hidePhone ipsType_break'>{$comment->author()->rank['title']}</li>
            {{endif}}
            {{if $comment->author()->rank['image'] && $comment->author()->member_id}}
                <li class='ipsResponsive_hidePhone'>{$comment->author()->rank['image']|raw}</li>
            {{endif}}

<li class='cAuthorPane_photo'>
         {{if $comment->author()->pp_main_photo}}
                  <a href='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}-{$comment->author()->name}" seoTemplate="profile" seoTitle="$seoName"}' data-ipsHover data-ipsHover-target='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}-{$comment->author()->name}&do=hovercard" seoTemplate="profile" seoTitle="$seoName"}' title="{lang="view_user_profile" sprintf="$name"}">
                          <span class='ipsUserPhoto ipsUserPhoto_variable'>
                                  <img src="{setting="base_url"}uploads/{$comment->author()->pp_main_photo}" />
                          </span>
                  </a>
         {{else}}
                  <a href='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}-{$comment->author()->name}" seoTemplate="profile" seoTitle="$seoName"}' data-ipsHover data-ipsHover-target='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}-{$comment->author()->name}&do=hovercard" seoTemplate="profile" seoTitle="$seoName"}' title="{lang="view_user_profile" sprintf="$name"}">
                          <span class='ipsUserPhoto ipsUserPhoto_variable'>
                                  <img src="<Path_to>/default_photo.png" />
                          </span>
                  </a>
         {{endif}}
</li>
            <li>{expression="\IPS\Member\Group::load( $comment->author()->member_group_id )->formattedName" raw="true"}</li>
            {{if \IPS\Member\Group::load( $comment->author()->member_group_id )->g_icon }}
                <li class='ipsResponsive_hidePhone'><img src='{file="$comment->author()->group['g_icon']" extension="core_Theme"}' alt='' class='cAuthorGroupIcon'></li>
            {{endif}}
            {{if $comment->author()->member_id}}
                <li class='ipsResponsive_hidePhone'>{template="reputationBadge" group="global" app="core" params="$comment->author()"}</li>
                <li class='ipsType_light'>{lang="member_post_count" pluralize="$comment->author()->member_posts"}</li>
                {{if $comment->author()->reputationImage()}}
                    <li class='ipsPad_half ipsResponsive_hidePhone'>
                        <img src='{file="$comment->author()->reputationImage()" extension="core_Theme"}' title='{{if $comment->author()->reputation()}}{$comment->author()->reputation()}{{endif}}' alt=''>
                    </li>
                {{endif}}
                {template="customFieldsDisplay" group="global" app="core" params="$comment->author()"}
            {{endif}}
        </ul>
    </aside>
    <div class='ipsColumn ipsColumn_fluid'>
        {template="post" group="topics" app="forums" params="$item, $comment, $item::$formLangPrefix . 'comment', $item::$application, $item::$module, $itemClassSafe"}
    </div>
</article>

Then go to CSS/core/front/custom/custom.css and add:

.cAuthorPane_photo img{
  max-width: 150px;
  max-height: 300px;
}

Then go to Admin CP/Groups and edit everygroup, tab Social, seti Maximum profile photo width/height to 300.

Edited by iGreen
Link to comment
Share on other sites

On 07/10/2017 at 9:16 AM, iGreen said:

Man it doesn't work with Veizor 1.0.1 for ips 4.2

It doesn't change anything. I wanted to have width 150px and height 300px 

Could you please telll how to edit it?

Thank you in advance. :)

Works easy this tutorial 

 

Link to comment
Share on other sites

@iGreen well glad u got it working man or atleast found an alternative, sorry if my method didnt work for u tho, would have been nice to find out why it wasnt working for u in the first place so i could fix it or at least amend it for future people so they dont encounter what u did

 

On 10/9/2017 at 2:40 PM, Comendator said:

Works easy this tutorial 

 

no offense dude but that code you used was first created and used by me without the minor mod of cAuthorPane in css you found/made and was first placed on webflake back in June 2015 by me, wherever you found that code just wanted you to know that i developed that code and it took me 1 and a half years of updating and experimenting with it before it reached where you got it from, yet I was never credited or acknowledged for what i did, sad really but my current code does work and it is less clustered than the current one there

well anyway man i got a fix for that default avatar which you had to manually link on that code in the thread use this and you wouldnt need to set the default path manually anymore

<img src="{resource="default_photo.png" app="core" location="global"}" />

lastly everyone is free to use whatever version they like so long as they get the result they so desire really hope they don't have much problems with the steps i laid out in the first post though

 

 

Edited by John
  • Like 1
Link to comment
Share on other sites

I can say that I have spent about 1 week trying to figure out how another website did it, sifting through their code. It has taken me a long time. I even searched, on google but I guess I was typing in all the wrong keywords. I finally found this post and thanks to you I've escaped IPB's forced square/circle for 4.0. I wish there was more of a way that I could personally thank you, other than just saying thank you so much. You're absolutely awesome for this. All the stress just left my head! :smiley_z:

Link to comment
Share on other sites

I can say that I have spent about 1 week trying to figure out how another website did it, sifting through their code. It has taken me a long time. I even searched, on google but I guess I was typing in all the wrong keywords. I finally found this post and thanks to you I've escaped IPB's forced square/circle for 4.0. I wish there was more of a way that I could personally thank you, other than just saying thank you so much. You're absolutely awesome for this. All the stress just left my head! :smiley_z:

Link to comment
Share on other sites

  • 2 weeks later...
1 hour ago, AfterDeath said:

I did exactly what the tutorial says, but nothing happens.
Can someone help me?

 

I use Surface_Dark skin

profile.jpg

You are also using a plugin i presume? to get all the other info. if this is the case you need to edit the template itself as the pugin will override the default options.

VAEfvMI.png

Liked what i posted remember to feed me a cookie ->
Or you can add a cookie to myCookieJar

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...