News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

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

Joel-san

#100
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:
This is what I had in mind.

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

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

<add><![CDATA[if (!empty($_POST['isblog'])) {
if(isset($_REQUEST['msg']) && !empty($_REQUEST['goback'])) {
redirectexit('action=blog;blog='. $_POST['isblog'] .';entry='. $topic .'#msg'. $_REQUEST['msg'], $context['browser']['is_ie']);
}
elseif(!empty($_REQUEST['goback'])) {
redirectexit('action=blog;blog='. $_POST['isblog'] .';entry='. $topic . '#last', $context['browser']['is_ie']);
}
else {
redirectexit('action=blog;blog='. $_POST['isblog']);
}
}
     
   ]]></add>

      </operation>
</file>


And...

Code (Blog.template.php) Select
line 53
Original ----------------------------------------
foreach ($context['posts'] as $post) {

echo '
<table border="0" cellspacing="1" cellpadding="4" class="bordercolor" width="100%">

New ----------------------------------------
foreach ($context['posts'] as $post) {

echo '
<a name="msg', $post['message_id'], '"></a>', !empty($context['viewing_single_entry']) && empty($context[$post['id']]['comments']) ? '<a name="last"></a>' : '';
echo '
<table border="0" cellspacing="1" cellpadding="4" class="bordercolor" width="100%">


--------------------------------------------------------------------------------
line 111
Original ----------------------------------------
foreach ($context[$post['id']]['comments'] as $comment) {

echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">

New ----------------------------------------
foreach ($context[$post['id']]['comments'] as $key => $comment) {

echo '
<a name="msg', $comment['message_id'], '"></a>', !empty($context['viewing_single_entry']) && $key + 1 == count($context[$post['id']]['comments']) ? '<a name="last"></a>' : '';
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">


Now the browser will return back to the entry if "return back to topic" checkbox is checked in additional options. It will also use anchors to scroll to correct height. When you add an new entry or a new comment it will be anchored with "last". When modifying an entry or a comment message id will be used instead for anchoring.


Next we want to return back to the entry if a comment was deleted when viewing a single entry.

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

<operation>

<search position="replace"><![CDATA[// We want to redirect back to recent action.
if (isset($_REQUEST['recent']))
redirectexit('action=recent');
elseif ($full_topic)
redirectexit('board=' . $board . '.0');
else
redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);]]></search>

<add><![CDATA[ // if this delete message request came from the blog page... redirect back to there
if (!empty($_REQUEST['blog'])) {
if(!empty($_REQUEST['entry'])) {
redirectexit('action=blog;blog='. $_REQUEST['blog'] .';entry='. $_REQUEST['entry']);
}
else {
redirectexit('action=blog;blog='. $_REQUEST['blog']);
}
}

else {
// We want to redirect back to recent action.
if (isset($_REQUEST['recent']))
redirectexit('action=recent');
elseif ($full_topic)
redirectexit('board=' . $board . '.0');
else
redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
}]]></add>

</operation>


And...

Code (Blog.template.php) Select
line 137
Original ----------------------------------------
// if they are allowed to delete the message, show a button for it
if ($comment['can_remove'])
echo '
<a href="', $scripturl, '?action=deletemsg;blog='. $context['blog_settings']['board_id'] .';topic=', $post['id'], '.0;msg=', $comment['message_id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '\');">', $delete_button, '</a>';

New ----------------------------------------
// if they are allowed to delete the message, show a button for it
if ($comment['can_remove']) {
if(!empty($context['viewing_single_entry'])) {
echo '
<a href="', $scripturl, '?action=deletemsg;blog='. $context['blog_settings']['board_id'] .';entry=', $post['id'], ';msg=', $comment['message_id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '\');">', $delete_button, '</a>';
}
else {
echo '
<a href="', $scripturl, '?action=deletemsg;blog='. $context['blog_settings']['board_id'] .';topic=', $post['id'], '.0;msg=', $comment['message_id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '\');">', $delete_button, '</a>';

}
}

computel

is there a fix for the comments not sure what I have to do or what changes are correct? Is there a new version?

Thanks

Joel-san

#102
Quote from: computel on July 09, 2008, 04:24:04 PMis there a fix for the comments not sure what I have to do or what changes are correct? Is there a new version?

Thanks
If messages are not appearing and you're using 1.11 try patching Blog.php (found in Sources directory) with this.

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

computel

I'm using the latest on and I hide the message from the main index. When you click on blog it shows the blogs and says 7 comments but no comments are showing up.

I Scream Cow

Not sure if you're familiar with the USER CP mod...but is there a certain way to put something in there so the member's blog CP can be in there instead of their old one?

cleanfiles

Hey guys,
I have 1.10 installed and I am having problems with the comments not showing, I see the issues have been sorted out in 1.11, but I was wondering what's the best way upgrade to the new package.
Should I uninstall the old version then install the new version, or is it easier to make the changes manually?
I have members with blogs already and I dont want them to have to start again.
Thanks.

computel

#106
Issues seem to still exist in 1.11 as I unistalled my 1.10 and installed 1.11 and I still can't see the comments.



Quote from: cleanfiles on July 09, 2008, 05:58:19 PM
Hey guys,
I have 1.10 installed and I am having problems with the comments not showing, I see the issues have been sorted out in 1.11, but I was wondering what's the best way upgrade to the new package.
Should I uninstall the old version then install the new version, or is it easier to make the changes manually?
I have members with blogs already and I dont want them to have to start again.
Thanks.

fords8

I wanted to let everyone know that the blog 1.11 is running great on one of my sites. I don't have any issues with comments.

Charles Hill

Yes I've tested the comments thoroughly on a blank forum.  No problems what so ever with v1.11 of this mod.  If you had a previous version (1.08 through 1.10) installed, and you uninstall then install 1.11 you will lose ZERO data.  Everything in your database tables will remain unchanged.  There were several things fixed from 1.10 to 1.11 so I think it'd be better to uninstall and install the newer version.

Charles Hill

#109
Quote from: I Scream Cow on July 09, 2008, 05:41:26 PM
Not sure if you're familiar with the USER CP mod...but is there a certain way to put something in there so the member's blog CP can be in there instead of their old one?

No I am not familiar with that mod, but i suspect it modifies a ton of the Profile files in SMF.  I will look at it when I have time and see if I can write a tutorial on manually editing your profile files when User Profile Control Panel mod is installed.

edit----

There don't seem to be any bugs that are causing usability issues, so the next version will probably be the last version of the blog mod.  Minor improvements will be made taking into account suggestions you all have made (examples: blog link tree on Post pages when posting to a blog, redirect to entry page instead of blog page when posting new topics and replies).

Thought... would it be easier if I made patches instead of redoing the entire blog mod package?  That way you all wouldn't have to manually edit the entire install again.

cleanfiles

#110
Quote from: Charles Hill on July 09, 2008, 08:23:47 PM
Thought... would it be easier if I made patches instead of redoing the entire blog mod package?  That way you all wouldn't have to manually edit the entire install again.
Sounds like a good idea to me. I am going to uninstall 1.10 and install 1.11 so fingers crossed.

Edit:
Installed 1.11 and all my bugs are gone, the improvements are spot on too. Awesome job m8, well done.
This is one of the most usefully mods I have installed.  :D   

computel

Uninstalled it and I still don't see the comments. Check out www.canadianracingonline.com/smf it says 12 comments but they don't show up but when you see them listed from the unread since last visit you see the comments but not when you click on blog from the menu bar.

Please help

Thanks


Quote from: Charles Hill on July 09, 2008, 08:17:58 PM
Yes I've tested the comments thoroughly on a blank forum.  No problems what so ever with v1.11 of this mod.  If you had a previous version (1.08 through 1.10) installed, and you uninstall then install 1.11 you will lose ZERO data.  Everything in your database tables will remain unchanged.  There were several things fixed from 1.10 to 1.11 so I think it'd be better to uninstall and install the newer version.

Charles Hill

Could you attach your Blog.php file please?

computel

Here is the blog.php attached.


Thanks

Charles Hill

There doesn't seem to be any problems with that Blog.php file.  Are you sure you have Display comments on main blog page checked?  Remember that each blog has its own settings.

computel

It is checked I checked it.

If you like I can make you a admin account and you can look at it.

It shows up in the forums if I don't hide the post on the index but not in the blog.

Thanks

Quote from: Charles Hill on July 10, 2008, 06:33:59 PM
There doesn't seem to be any problems with that Blog.php file.  Are you sure you have Display comments on main blog page checked?  Remember that each blog has its own settings.

Charles Hill

Could you make me an account that has all the blog permissions?  I don't need admin to check this.

computel

Here is a copy of the Blog.template.php you requested.

Thanks

Charles Hill

Are you getting any errors in your forum's error log?

Joel-san

#119
I would still suggest that computel isn't seeing the comments because of the AND NOT in the MySQL querys in getComments function.

Advertisement: