Jump to content
Zayed.Solutions

How to add post shadow to "Highlight Post Per User Group" 1.3.1


Recommended Posts

Hi,

I'm migrating my old forum from plugin "Post Formatting per User Group" to new "Highlight Post Per User Group" app (1.3.1).

I can't migrate one setting which is crucial to look & feel of my forum.

Previously I had a nice shadow in the color of border around specific group member posts. After migration I can't bring this back and I don't know where I can modify the code / CSS to get such effect.

OLD & expected formatting:

image.thumb.png.83f15aff4c687ed0217f9f6fe87969fa.png

And NEW formatting after migration:

image.thumb.png.b4a4494cef1d754f683d3457fe7a9690.png

Please, let me know where I can add this nice shadow or how can I turn it on.

Thanks!

Link to comment
Share on other sites

@A Zayed It seems that something is broken. Version 1.3.1 worked OK, but 1.3.2 gives errors in my test environment. Screen attached. 

image.thumb.png.3642a37efbe430feea761d69d8a689f5.png

There is a shadow, but different one than I used to have.

Would it be possible to add another setting in options that would allow me to add custom shadow CSS? 

In example: there could be a text-box in options "Custom shadow style:" and I would fill the text box with: box-shadow: 0px 1px 8px #311b6a !important; 
or 
box-shadow: 0px 1px 8px 1px rgba( 49,27,106, 0.6 ) !important;

What do you think? Would that be possible? It would allow me to set different parameters for different user groups and even different shadow color (from border color) for each group.

BTW: currently in the 1.3.2 plugin shadow is different from what I used to have. Comparison (old = left, new 1.3.2 = right):

image.png.ede4777cd0064d5f63e9f1921835e378.png     image.png.da586f213f71148422685d1123518254.png

New one looks like solid second frame and old one - more like a disappearing shadow (I liked that).

Looking forward for info!

Link to comment
Share on other sites

@A Zayed I think I found the reason of errors: when "Consider Secondary Group" is enabled in 1.3.2 then plugin gives errors. After disabling of this option - there are no errors generated.

Anyway - it would be great to have "custom shadow CSS" option added. Thanks!

image.png.8a845d7715a38a1dd30e0e18e6de63fe.png

Edited by Michal Szafranski
Link to comment
Share on other sites

Thanks @Michal Szafranski for figuring the secondary groups issue. This should be fixed in version 1.3.3

Also, to adjust the shadow effect, I moved the styling to a separate phtml template, so that you can modify it.

Feel free to modify the below styling in these templates:

highlightpost => front => styling => postsListing

image.thumb.png.ab66f666618d9424d9b3f28b571de723.png

Modify the highlighted line, (It's written in the template twice)

Link to comment
Share on other sites

  • 2 weeks later...

Hi @A Zayed!

Unfortunately 1.3.3 is throwing exceptions on my site. As I'm not developer I asked my dev friend to check what might be the reason and he pointed me to this part of code:

			$parent = parent::getStore();

			$custom = iterator_to_array( \IPS\Db::i()->select( '*', 'highlightpost_groups' )->setKeyField( 'g_id' ) );	

			

			$new_groups = array();

			

			/* Updating Caches */

			foreach( $parent as $k => $v )

			{

				if( isset( $custom[ $k ] ) )

				{

					$new_groups[$k] = array_merge(\IPS\Data\Store::i()->groups[$k], array( 'posts_bg' => $custom[ $k ]['posts_bg'], 'posts_border' => $custom[ $k ]['posts_border'], 'posts_color' => $custom[ $k ]['posts_color'] ) );

				}

				else

				{

					$new_groups[$k] = array_merge(\IPS\Data\Store::i()->groups[$k], array( 'posts_bg' => "", 'posts_border' => "", 'posts_color' => "" ) );

				}

			}

	

			\IPS\Data\Store::i()->groups = $new_groups;	

	

			return \IPS\Data\Store::i()->groups;

I asked for clarification and he said that your code doesn't properly write data to variable:

\IPS\Data\Store::i()->groups

Could you please check this code and make sure that the format and content is given in proper way?

I don't know whether this diagnosis is OK as I'm not developer - just forwarding information I received from my buddy.

I hope it helps. I'm looking forward for info!

Link to comment
Share on other sites

7 hours ago, Michal Szafranski said:

Hi @A Zayed!

Unfortunately 1.3.3 is throwing exceptions on my site. As I'm not developer I asked my dev friend to check what might be the reason and he pointed me to this part of code:

			$parent = parent::getStore();

			$custom = iterator_to_array( \IPS\Db::i()->select( '*', 'highlightpost_groups' )->setKeyField( 'g_id' ) );	

			

			$new_groups = array();

			

			/* Updating Caches */

			foreach( $parent as $k => $v )

			{

				if( isset( $custom[ $k ] ) )

				{

					$new_groups[$k] = array_merge(\IPS\Data\Store::i()->groups[$k], array( 'posts_bg' => $custom[ $k ]['posts_bg'], 'posts_border' => $custom[ $k ]['posts_border'], 'posts_color' => $custom[ $k ]['posts_color'] ) );

				}

				else

				{

					$new_groups[$k] = array_merge(\IPS\Data\Store::i()->groups[$k], array( 'posts_bg' => "", 'posts_border' => "", 'posts_color' => "" ) );

				}

			}

	

			\IPS\Data\Store::i()->groups = $new_groups;	

	

			return \IPS\Data\Store::i()->groups;

I asked for clarification and he said that your code doesn't properly write data to variable:

\IPS\Data\Store::i()->groups

Could you please check this code and make sure that the format and content is given in proper way?

I don't know whether this diagnosis is OK as I'm not developer - just forwarding information I received from my buddy.

I hope it helps. I'm looking forward for info!

Hello Michael,

Can you share the exception error?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...