zCommunity 0.8.1 Beta Now available! (supports SMF 2.0 RC1 and 1.1.8)

Started by Charles Hill, June 16, 2008, 03:33:34 PM

Previous topic - Next topic

legen91

i did but then deleted and reinstalled it because it wasnt working now i have it working and that wont leave

legen91

Never mind issue resolved

Joel-san

#82
Nice mod. I would like add it to my page but it's still too buggy. I'm using SMF 1.1.5 with the default theme. So far I have run into the following bugs (version 1.10).

1. I can't remove any posts or boards after installing Blog mod.
Fatal error: Call to undefined function getCurrentCategory() in .../RemoveTopic.php on line 317

2. The link to the last post in blog index is broken. It returns the user back to the forum index. Currently the url is like this: index.php?blog=xx;entry=xxx. You need to add action=blog for it to work correctly. Also it would make more sense if the last post would be the last blog entry made by the blog owner, not the last comment made by some reader.  It would be nice to see the name of the owner of the blog in the blog index.

3. Comments don't show up. Didn't show up in 1.08 either when I tried it.

4. What's the purpose of the "remove this" bar? It's just annoying.

EDIT:

5. When in single blog mode I cannot add new entrys from the blog index. I have to navigate to the blog board from the forum index and add a new entry (topic) from there. Navigating gets a bit hard when the blog board is hidden. Hehe...

computel

I installed it and gave my members permission but they can't create a blog. They can read ones I do and cmment but not create their own. how do I fix this.

Thanks

Charles Hill

@Joel-san...
1. fixed for v1.11
2. fixed for v1.11
3. I tested again on my blank forum and I wasn't having any problems with comments.  Are you sure you have "Display comments on main blog page" checked?
4. There was supposed to be a link above that saying "Resume reading where you left off" and it takes you to where the Read more link cut off the topic. on the blog page.  I fixed this for v1.11
5.  fixed for v1.11

Quote from: computel on July 08, 2008, 12:20:14 PM
I installed it and gave my members permission but they can't create a blog. They can read ones I do and cmment but not create their own. how do I fix this.

Thanks
Did you install v1.10?  v1.08 and v1.09 had this problem.

fords8

v1.10 does fix the members can't create a blog issue. I just tested it out. Charles, very nice job! Looking forward to more updates on this.

Joel-san

Thanks for the updates! I'll try to find out why comments aren't showing up.

computel

#87
Fixed it. It was the version.

Thanks

Quote from: Charles Hill on July 08, 2008, 01:36:20 PM
@Joel-san...
1. fixed for v1.11
2. fixed for v1.11
3. I tested again on my blank forum and I wasn't having any problems with comments.  Are you sure you have "Display comments on main blog page" checked?
4. There was supposed to be a link above that saying "Resume reading where you left off" and it takes you to where the Read more link cut off the topic. on the blog page.  I fixed this for v1.11
5.  fixed for v1.11

Quote from: computel on July 08, 2008, 12:20:14 PM
I installed it and gave my members permission but they can't create a blog. They can read ones I do and cmment but not create their own. how do I fix this.

Thanks
Did you install v1.10?  v1.08 and v1.09 had this problem.

computel

#88
Ok I got the blog working with 1.11 but noticed it shows comments but where do you see these comments? and the box is checked to display them on the main page. I also noticed if you set the non-admin blogs to 0 or a number it still only allows the non-admin to initilize only on blog.

I guess the user could create categories and that would break it up.

Thanks


Hoochie Coochie Man

Hi @Charles Hill
Thank you very much for this great mod.
Here is Turkish language strings

// blog txt variables
// Çeviri by Hoochie Coochie Man
$txt['blog'] = 'Blog';
$txt['blogs'] = 'bloglar';
$txt['Blogs'] = 'Bloglar';
$txt['showBlogs'] = 'Blogları Göster';
$txt['blog_category'] = 'Blog Kategorisi';
$txt['blog_settings'] = 'Blog Ayarları';
$txt['blogControlPanel'] = 'Blog Kontrol Paneli';
$txt['blog_links'] = 'Linkler';
$txt['permissiongroup_blog'] = 'Blog';
$txt['permissionname_write_blog'] = 'Kendi bloğunu yapabilir';
$txt['permissionname_multiple_blogs'] = 'Birçok blog yapabilir';
$txt['permissionname_delete_own_blogs'] = 'Kendi bloglarını silebilir';
$txt['permissionname_blog_restrict_access'] = 'Blogunu/Bloglarını üye gruplarına göre sınırlandırabilir';
$txt['no_blogs'] = 'Hiç blog yok';
$txt['blog_index'] = 'Blog dizini';
$txt['view_blog_of_user'] = 'Bu üyenin Bloğuna bak.';
$txt['view_blogs_of_user'] = 'Bu üyenin Bloglarına bak.';
$txt['goToBlog'] = 'Bloğa git';
$txt['blog_removethis'] = 'Bunu sil';
$txt['go_to_cutoff'] = 'Kaldığın yerden okumaya devam et...';
$txt['only_blog_owner'] = 'Yalnızca blog sahibi yeni konu açabilir';


İnadına SMF 1.1.X

Joel-san

#90
For me too it shows correctly the number of the comments but it doesn't actually show the comments. So far I have been able track the problem to Blog.template.php line 112.

if (!empty($modSettings['display_comments_blog'])) {

if (!empty($context[$post['id']]['comments'])) {

foreach ($context[$post['id']]['comments'] as $comment) {


$modSettings['display_comments_blog'] is always empty because display_comments_blog is stored in $context['blog_settings'] variable. Then comes the next problem: $context['post id xxx']['comments'] is always empty too. It would also seem no matter if I check or uncheck display comments checkbox $context['blog_settings']['display_comments_blog'] is always 1. However the value is changed in smf_blog_settings table so the error is definitely in some function that reads from the database. Maybe the table name is hard coded in that function. My table prefix is smf2_.

EDIT: Regarding the issue of $context['blog_settings']['display_comments_blog'] always being 1 I opened Blog.php and looked at the Blog function. I quickly found the reason in line 108.

'display_comments_blog' => !empty($temp['display_comments_blog']) ? $temp['display_comments_blog'] : 1,

No wonder it ends up being 1 every time. Change the line to this and it works.

'display_comments_blog' => !empty($temp['display_comments_blog']) ? $temp['display_comments_blog'] : 0,

While fixing that you should also fix enableRecentEntries and enableArchives.

num_recent_entries, max_topics_on_blog, max_length_topics, max_comments_per_topic and max_length_comments aren't going to work when setting 0 for no limit because 0 is treated as empty. Isset would be more approriate in this case.

Charles Hill

Thanks for all the help :)  I'll get the mod package updated with v1.11 later this evening and all these issues with be resolved.

Joel-san

#92
Okay. Finally comments are appearing. Here are all the fixes I made.

Blog.template.php
line 112
Original ----------------------------------------
if (!empty($modSettings['display_comments_blog'])) {

New ----------------------------------------
if (!empty($context['blog_settings']['display_comments_blog'])) {


Blog.php
line 106–114
Original ----------------------------------------
'max_topics_on_blog' => !empty($temp['max_topics_on_blog']) ? $temp['max_topics_on_blog'] : 5,
'max_length_topics' => !empty($temp['max_length_topics']) ? $temp['max_length_topics'] : 2400,
'display_comments_blog' => !empty($temp['display_comments_blog']) ? $temp['display_comments_blog'] : 1,
'max_comments_per_topic' => !empty($temp['max_comments_per_topic']) ? $temp['max_comments_per_topic'] : 3,
'max_length_comments' => !empty($temp['max_length_comments']) ? $temp['max_length_comments'] : 500,
'enableRecentEntries' => !empty($temp['enableRecentEntries']) ? $temp['enableRecentEntries'] : 1,
'enableCategoryList' => !empty($temp['enableCategoryList']) ? $temp['enableCategoryList'] : 0,
'enableArchives' => !empty($temp['enableArchives']) ? $temp['enableArchives'] : 1,
'num_recent_entries' => !empty($temp['num_recent_entries']) ? $temp['num_recent_entries'] : 7,

New ----------------------------------------
'max_topics_on_blog' => isset($temp['max_topics_on_blog']) ? $temp['max_topics_on_blog'] : 5,
'max_length_topics' => isset($temp['max_length_topics']) ? $temp['max_length_topics'] : 2400,
'display_comments_blog' => !empty($temp['display_comments_blog']) ? $temp['display_comments_blog'] : 0,
'max_comments_per_topic' => isset($temp['max_comments_per_topic']) ? $temp['max_comments_per_topic'] : 3,
'max_length_comments' => isset($temp['max_length_comments']) ? $temp['max_length_comments'] : 500,
'enableRecentEntries' => !empty($temp['enableRecentEntries']) ? $temp['enableRecentEntries'] : 0,
'enableCategoryList' => !empty($temp['enableCategoryList']) ? $temp['enableCategoryList'] : 0,
'enableArchives' => !empty($temp['enableArchives']) ? $temp['enableArchives'] : 0,
'num_recent_entries' => isset($temp['num_recent_entries']) ? $temp['num_recent_entries'] : 7,

--------------------------------------------------------------------------------
line 751
Original ----------------------------------------
AND NOT ID_MSG = $exclude_message

New ----------------------------------------
AND ID_MSG != $exclude_message

--------------------------------------------------------------------------------
line 762
Original ----------------------------------------
AND NOT m.ID_MSG = $exclude_message

New ----------------------------------------
AND m.ID_MSG != $exclude_message


As I said comments are now showing up but there's still one issue to be solved. When you disable the comments from showing in the main blog page that actually disables them everywhere. You will not see the comments even if you view a single entry by clicking Read More. You need to set display_comments_blog to 1 and max_comments_per_topic and max_length_comments to 0 (no limit) as we are not in the main blog page but viewing a single entry.

Charles Hill

Thanks for the help, Joel-san.  I really appreciate it.  I fixed everything and tested it all on my dev site.  I am adding a link tree now just for the blog pages to help make navigation easier.  Once I am done with that I'll package it all up and test it on my default blank forum.  Thank you all for your patience.

Charles Hill

Just updated it to v1.11.  Hope there are no more problems ;D

About other languages:
I'll make additional zip files with translations available as soon as I get the time to compile them.

About additional functionality and/or add-on requests:
I'll make add-ons for the Blog Mod available in separate mod packages within the Blog Readme topic on my site and in the Blog Mod page on the Simple Machines mod site.

serge2

I have this in my forum error log after installed 1.11:

8: Undefined index: extra_links
File: \Themes\default\languages\Stats.english.php



Thanks for the mod.

Joel-san

#96
Well I'm sorry to say but comments aren't still not showing up. Here are what I did to fix it.

Code (Blog.php) Select
line 788
Original ----------------------------------------
AND NOT ID_MSG = $exclude_message

New ----------------------------------------
AND ID_MSG != $exclude_message

--------------------------------------------------------------------------------
line 799
Original ----------------------------------------
AND NOT ID_MSG = $exclude_message

New ----------------------------------------
AND ID_MSG != $exclude_message


As you can see these are the same fixes I posted earlier. Maybe you missed these accidentally.

When viewing a single entry comments were limited if max_length_comments was set to something. Fortunately it wasn't hard to fix that. Otherwise it was working great.

Code (Blog.php) Select
line 807
Original ----------------------------------------
if (isset($comment_length) && is_numeric($comment_length)) {

New ----------------------------------------
if (isset($comment_length) && is_numeric($comment_length) && empty($context['viewing_single_entry'])) {


I like the blog navigation tree. Could the forum navigation tree be replaced by the blog navigation tree when posting a new entry or a comment? After posting an entry or a comment the browser should show a single entry or return to then blog index depending on the "return to this topic" found in additional options. Currently it always returns back to the blog index.

Charles Hill

#97
I fixed the comments issue in v1.11, Joel....

From getComments...
$rows = mysql_num_rows(db_query("
SELECT ID_MSG
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic
AND NOT ID_MSG = $exclude_message
ORDER BY posterTime DESC " . ((!empty($limit_comments) && empty($context['viewing_single_entry'])) ? "
LIMIT $limit_comments" : ''), __FILE__, __LINE__));


This makes it apply the limitation on how many comments to show only when seeing a topic and its comments on a blog's main page.

From Blog.template.php:
if (!empty($context['blog_settings']['display_comments_blog']) || !empty($context['viewing_single_entry'])) {

if (!empty($context[$post['id']]['comments'])) {

foreach ($context[$post['id']]['comments'] as $comment) {

This means that comments will be displayed if comments are enabled on a blog's main page OR if you are viewing a single entry.

QuoteI like the blog navigation tree. Could the forum navigation tree be replaced by the blog navigation tree when posting a new entry or a comment? After posting an entry or a comment the browser should show a single entry or return to then blog index depending on the "return to this topic" found in additional options. Currently it always returns back to the blog index.
Glad you like it :)  And I'll figure out a way to replace the forum's link tree with the blog link tree when posting and replying in blog boards.

edit----
Check the following changes made to Post.php and Post.template.php to make sure you are getting redirected properly after posting:
<file name="$themedir/Post.template.php">

<operation>

<search position="after"><![CDATA[<input type="submit" name="post"]]></search>

<add><![CDATA[', !empty($context['blogBoard']) ? '<input type="hidden" name="isblog" value="'. $context['blogBoard'] .'" />' : '', '
]]></add>

</operation>
</file>

<file name="$sourcedir/Post.php">

<operation>

<search position="after"><![CDATA[if (!empty($_POST['announce_topic']))]]></search>

<add><![CDATA[if (!empty($_POST['isblog']))
redirectexit('action=blog;blog='. $_POST['isblog']);

]]></add>

</operation>
</file>

Charles Hill

Quote from: serge2 on July 09, 2008, 05:55:33 AM
I have this in my forum error log after installed 1.11:

8: Undefined index: extra_links
File: \Themes\default\languages\Stats.english.php



Thanks for the mod.

in Blog.template.php......

FIND:
$context['extra_links']

REPLACE WITH:
', !empty($context['extra_links']) ? $context['extra_links'] : '', '

:)

Joel-san

Quote from: Charles Hill on July 09, 2008, 10:16:12 AMI fixed the comments issue in v1.11, Joel....
I noticed you applied all the other fixes but you didn't change the MySQL query. AND NOT ID_MSG = $exclude_message isn't working for me. It needs to be changed to AND ID_MSG != $exclude_message for the query to work.

Quote from: Charles Hill on July 09, 2008, 10:16:12 AMFrom getComments...
$rows = mysql_num_rows(db_query("
SELECT ID_MSG
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic
AND NOT ID_MSG = $exclude_message
ORDER BY posterTime DESC " . ((!empty($limit_comments) && empty($context['viewing_single_entry'])) ? "
LIMIT $limit_comments" : ''), __FILE__, __LINE__));


This makes it apply the limitation on how many comments to show only when seeing a topic and its comments on a blog's main page.
I guess I wasn't clear enough. All the comments are shown fine but character limiting on comments is still taking effect when viewing a single entry. Adding && empty($context['viewing_single_entry']) into the if clause before substr takes care of it.

Quote from: Charles Hill on July 09, 2008, 10:16:12 AMedit----
Check the following changes made to Post.php and Post.template.php to make sure you are getting redirected properly after posting:
I'll check it out.

Advertisement: