solved Help on PJ News

Dazed
Dazed
@dazed
11 years ago
1,022 posts
I want to enable a few users to be able to post on the News template and so far it has been a bust.

Below are the current 2 templates. When I add in profile id's of search1="_profile_id = 1,2,3" nothing appears on the index.

I also changed the site_news.tpl to have the corresponding user/profile ids. I also looked at the skin global settings and if I add 1,2,3 that also wreaks havoc as it kills the slider.

So what is the easiest way to allow more users to post news items?

Thanks!!



index.tpl
            {jrCore_list module="jrBlog" order_by="_created desc" search1="_profile_id = `$_conf.Mixposure_blog_profile`" search2="blog_category = news" template=$site_news_template pagebreak="4" page=$_post.p}


site_news.tpl
{if isset($_conf.Mixposure_blog_profile) && $_conf.Mixposure_blog_profile > 0}
    {jrCore_list module="jrBlog" order_by="_created desc" search1="_profile_id = `$_conf.Mixposure_blog_profile`" search2="blog_category = news" template=$site_news_template pagebreak="4" page=$_post.p}
{else}
    {jrCore_list module="jrBlog" order_by="_created desc" search1="_user_id = 1" search2="blog_category = news" template=$site_news_template pagebreak="4" page=$_post.p}
{/if}

updated by @dazed: 10/08/14 07:11:49PM
brian
@brian
11 years ago
10,148 posts
Your search should be:

 search1="_profile_id in 1,2,3"

If you pass in a comma list of ids, you must use "in" instead of "=".

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
11 years ago
1,022 posts
damn should have caught that. It is basically an sql query.

Thanks Brian
updated by @dazed: 08/31/14 08:22:26AM
brian
@brian
11 years ago
10,148 posts
Dazed:
damn should have caught that. It is basically an sql query.

Thanks Brian

Well yes and no - the numbers inside are validated, so it's not going directly into a query, but it's the same "idea" ;)

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
11 years ago
1,022 posts
ok I see one issue. For whatever reason, the posted info/social media info is listed once for the poster and once for the admin.
jpg
 •  26KB


updated by @dazed: 08/31/14 08:29:36AM
brian
@brian
11 years ago
10,148 posts
You're going to want to check your list call or template and make sure it is only including the id's you want, or only rendering what you want.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Yeah I am looking at it but I do not see why it is bringing in both. There is a conditional statement there - item.profile_id == '1' that I have played with but it did not make a difference.

        <div id="site_news_div" class="body_3" style="margin-bottom:40px;">
            {* ROW TEMPLATE *}
            {capture name="row_template" assign="site_news_template"}
                {literal}
                    {if isset($_items)}
                    {jrCore_module_url module="jrBlog" assign="murl"}
                    {foreach from=$_items item="item"}
                    <div style="padding:10px;">
                        <div class="br-info" style="margin-bottom:20px;">
                            <div class="blog-div">
                                <span class="blog-user capital"> By {$item.profile_name}</span>
                            </div>
                            <div class="blog-div">
                                <span class="blog-date"> {$item.blog_publish_date|jrCore_format_time:false:"%m/%d/%y"}</span>
                            </div>
                            <div class="blog-div">
                                <span class="blog-tag capital"> Tag: {$item.blog_category}</span>
                            </div>
                            {if jrCore_module_is_active('jrComment')}
                            <div class="blog-div">
                                <span class="blog-replies">
			                    {if $item.profile_id == '1'}
                                    <a href="{$jamroom_url}/news_story/{$item.blog_title_url}#comments"><span class="capital">{jrCore_lang module="jrBlog" id="27" default="comments"}</span>: {$item.blog_comment_count|default:0}</a>
                                {else}
                                	<a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.blog_title_url}#comments"><span class="capital">{jrCore_lang module="jrBlog" id="27" default="comments"}</span>: {$item.blog_comment_count|default:0}</a>
                                {/if}
                                </span>
                                <span class="normal"> | </span>
                                <span class='st_facebook' st_title='{$item.blog_title|escape}' st_url='{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.blog_title_url}'></span><span class='st_twitter' st_title='{$item.blog_title|escape}' st_url='{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.blog_title_url}'></span><span class='st_email' st_title='{$item.blog_title|escape}' st_url='{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.blog_title_url}'></span><span class='st_sharethis'></span>
                            </div>
                            {/if}
                            {if jrUser_is_master()}
                            <div class="float-right">
                            	<a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.blog_title_url}">{jrCore_icon icon="gear" size="18"}</a>
                            </div>
                            {/if}
                            <div class="clear"></div>
                        </div>
                        <h3><a href="{$jamroom_url}/news_story/{$item.blog_title_url}">{$item.blog_title}</a></h3>
                        <div class="blog-text">
                            {if isset($item.blog_image_size) && $item.blog_image_size > 0}
                            {jrCore_module_function function="jrImage_display" module="jrBlog" type="blog_image" item_id=$item._item_id size="large" alt=$item.blog_title width="128" height="128" crop="auto" class="iloutline img_shadow" style="float:left;margin-right:8px;margin_bottom:8px;"}
                            {/if}
                            {$item.blog_text|jrCore_format_string:$item.profile_quota_id|jrBlog_readmore|jrEmbed_embed|nl2br}
                        </div>
                    </div>
{* share this http://sharethis.com *}
<script type="text/javascript">var switchTo5x = true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({ldelim}publisher:"388dfdea-9f20-4afd-ad57-a451dd00eac1"{rdelim});</script>
                    {/foreach}
brian
@brian
11 years ago
10,148 posts
I think I might be confused - how is it double? Are you talking about the "by line" in the image?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
11 years ago
10,148 posts
Your ShareThis code should not be in the foreach loop either.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Hey Brian - This is the stock site_news.tpl template. And yes I mean the by line info. So the user I added created a test thread and I am displaying the admin info as well.
douglas
@douglas
11 years ago
2,797 posts
I'm not seeing any issues with this, are you using a modified template in your ACP > Skins > Templates section?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Douglas did you add a secondary user to post in the News section? When I add the below on the index.tpl I get the dual "By" line for user and admin. The same is true for modifying the site_news.tpl.

            {jrCore_list module="jrBlog" order_by="_created desc" search1="_profile_id in 1,166144" search2="blog_category = news" template=$site_news_template pagebreak="4" page=$_post.p}

updated by @dazed: 08/31/14 10:36:36AM
douglas
@douglas
11 years ago
2,797 posts
Yes, I've got the admin and a user showing in the site news tab on the index page with no issues.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
douglas
@douglas
11 years ago
2,797 posts
Dazed:
Douglas did you add a secondary user to post in the News section? When I add the below on the index.tpl I get the dual "By" line for user and admin. The same is true for modifying the site_news.tpl.

            {jrCore_list module="jrBlog" order_by="_created desc" search1="_profile_id in 1,166144" search2="blog_category = news" template=$site_news_template pagebreak="4" page=$_post.p}

I added the ID's the skins setting "Blog Profiles" field and changed the jrCore_list functions to use "in" instead of "=".


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
ok i can try that route also.
Dazed
Dazed
@dazed
11 years ago
1,022 posts
made the change that way but I still am showing the "Posted By" row for both admin and other user that is posting.
Dazed
Dazed
@dazed
11 years ago
1,022 posts
it may be my skin. It looks like you have done a lot of changes so let me look at it.
Dazed
Dazed
@dazed
11 years ago
1,022 posts
just did a second look and I see what the issue is. Because the test post is short, the second post info is jumping up next and ends up next to the image. How is a good way to fix this? I just added 7 lines of text and the uploaded image is still larger than the rows and the second posts Info line is actually being cutoff by the image.

Ideas?
jpg
 •  50KB


updated by @dazed: 08/31/14 02:02:38PM
douglas
@douglas
11 years ago
2,797 posts
You might check the code again, what I have only shows one blog/news entry per page, you may have the pagebreak set to something other than 1?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
page break set to 4.
brian
@brian
11 years ago
10,148 posts
You need to have a "clear: both" on the div so it doesn't let the shorter div "float up" to the right of the previous div.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
11 years ago
1,022 posts
perfect. Thanks everyone :)
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Just ran into a new bug on this one. When I click the comment link for admin posts, I go to a blank news page. This only happens on the admin posts. The 3 users I added I am able to see comments. Nothing is jumping out at me on this. Any ideas?
michael
@michael
11 years ago
7,772 posts
need to see it happening. steps to see it happening please.
Dazed
Dazed
@dazed
11 years ago
1,022 posts
hey Michael - Pretty much everything is in this post.

Readers Digest version:
Modified site_news and index to be "in" vs "=" on the blog call for category "News".
Changed the Global values for "Blog Profile" to include admin plus a few other users.
Then post as an admin and one of the users.
on the index page click the comments to add a comment for the admin
result - comment box not visible
add a comment as a user
result - comment box visible
expected result - all users should be able to reply to a post from admin or user in the "News" category
brian
@brian
11 years ago
10,148 posts
Dazed:
hey Michael - Pretty much everything is in this post.

Readers Digest version:
Modified site_news and index to be "in" vs "=" on the blog call for category "News".
Changed the Global values for "Blog Profile" to include admin plus a few other users.
Then post as an admin and one of the users.
on the index page click the comments to add a comment for the admin
result - comment box not visible
add a comment as a user
result - comment box visible
expected result - all users should be able to reply to a post from admin or user in the "News" category

Do you have a link to the comment page? Comments needs to be located on the item's detail page - if you are instead linking to a special "view this news entry" page where you are trying to add the comments, it may not work properly.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Hey Brian it is the default page. Just hit mixposure.com and scroll to the new section. Click the comment links for member and admin and you will see.

This is the default site_news.tpl with the change to use multiple users.
douglas
@douglas
11 years ago
2,797 posts
It actually does work,I've got it setup on my dev site and I'm not seeing any issues.

The admin site news blogs go to the news_story page when clicking the comments link and the comment form is there and works.

However, when clicking a users site news blog comments link, it takes you to that users profile blog detail page.

You might check your comments link code and make sure your using the latest code.

Hope this helps,
Douglas


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Yeah I am not using the latest pj skin. I started modifying mine and noticed you guys moved the side page to the right side so I stopped and reverted back. Is there an option on left or right side somewhere? I am just used to it being on the left.
douglas
@douglas
11 years ago
2,797 posts
No, there is no option, it was moved to the right so it works better with mobile devices.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
douglas
@douglas
11 years ago
2,797 posts
Are you talking about the comments box on the right side?

Because I am seeing some issues there, I may need to checkout the ProJam skin and make sure everything is still working like it should.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Hey Douglas. First of all thanks for the help. I am referring to the side.tpl. I am not a big fan of it on the right side after having it on the left side for several years.

What I see is that on my site, on the index.tpl when I click the comments link on and admin post with a category of News, there is no option to add comments. ex. http://www.mixposure.com/news_story/welcome-new-artists.
douglas
@douglas
11 years ago
2,797 posts
That is because there is no blog ID in your URL... in your index.tpl and site_news.tpl, the code for the comments link should look like this:

{if $item.profile_id == '1'}
<a href="{$jamroom_url}/news_story/{$item._item_id}/{$item.blog_title_url}#comments"><span class="capital">{jrCore_lang module="jrBlog" id="27" default="comments"}</span>: {$item.blog_comment_count|default:0}</a>
{else}
<a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.blog_title_url}#comments"><span class="capital">{jrCore_lang module="jrBlog" id="27" default="comments"}</span>: {$item.blog_comment_count|default:0}</a>
{/if}

Hope this helps! :)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
I will take a look Douglas thanks. This is why the change to the right side is bothering me because I am kind of forced to make the change in order to stay current.

I appreciate the help.
douglas
@douglas
11 years ago
2,797 posts
Not necessarily, The code is the same if its on the right or left side. Just let me know where your having the issue and I'm sure I can help you leave your left side in tact. ;)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
ok will do. Much appreciated.
Dazed
Dazed
@dazed
11 years ago
1,022 posts
ok made that change and still the same result. :(
douglas
@douglas
11 years ago
2,797 posts
Can you send me your admin login as well as your FTP info so I can take a look?

douglas[at]jamroom[dot]net

Thanks!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
on way
douglas
@douglas
11 years ago
2,797 posts
You should be set. Note that I also fixed the links on your News page to work with the news_story.tpl that I had to modify.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
Thanks Douglas. I see a bit of an oddity though. The first admin news story does not display a comment box. The other 2 stories do though.

What did you find? I will do a compare and see but these were really unmodified sections.
douglas
@douglas
11 years ago
2,797 posts
Are comments enabled for the admin quota?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
11 years ago
1,022 posts
yep. it is working now so all is well. Thanks again Douglas.
douglas
@douglas
11 years ago
2,797 posts
No problem, glad I could help.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos