×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Mamblog plugin frontend does nothing

Mamblog plugin frontend does nothing 15 years 8 months ago #548

  • carsten888
  • carsten888's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 46
  • Thank you received: 32
I am trying to use joomlacomment with mamblog.

I installed joomlacomment and it works great on normal content, so far so good. I installed the plugin for Mamblog (2 hacked files), which gives me in the Mamblig backend the option to assign Joomlacomment as the commentsystem to be used by Mamblog.

However, at the frontend nothing is changed. No links under each blog to comment and in full view no editor. Altogether not a sign of joomlacomment being alive in com_mamblog.

So I guess I need to make a new setting for joomlacomment in the admin (components > joomlacomment > other components settings) to make it work with Mamblog. So I go there and click new.
At the 'components' select-box there is no Mamblog?

Mamblog plugin frontend does nothing 15 years 8 months ago #549

  • carsten888
  • carsten888's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 46
  • Thank you received: 32
update:
I thought the loop in the selectbox might just have forgotten mamblog (because the plugin-hack did not update anything in the joomlacooment admin). So I made a new setting for com_docman, went into the database and changed it to 'com_mamblog'. When trying to edit these settings I got this error:

string(78) "joomlacomment: unexpected error. No plugin found for component 'com_mamblog' !"

ok, I got myself to blame for that. :silly:

But, seriously, how to get Joomlacomment to work with Mamblog? :dry:

Joomla 1.0.15
Joomlacomment 3.26
Mamblog 1.0

Mamblog plugin frontend does nothing 15 years 8 months ago #560

  • carsten888
  • carsten888's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 46
  • Thank you received: 32
I've tried to make a mambot-plugin. All the Joomlacomment-output I get on the mamblog pages is this code:
<!-- START of joscomment --><!-- END of joscomment -->
So the bot is included but not doing its thing.

I am completely stuck with this now.:(
Is there any way to get in touch with the person that has been working on the mambot plugin?

Mamblog plugin frontend does nothing 15 years 8 months ago #565

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081

I installed the plugin for Mamblog (2 hacked files), which gives me in the Mamblig backend the option to assign Joomlacomment as the commentsystem to be used by Mamblog.


I'm not absolutly sure I understand you - what is mamblig?

Did you enable the plugin in !jocomment-> other component settigns?

Mamblog plugin frontend does nothing 15 years 8 months ago #574

  • carsten888
  • carsten888's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 46
  • Thank you received: 32

the Mamblig backend

I'm not absolutly sure I understand you - what is mamblig?

sorry, typo, my mistake, I meant the Mamblog backend.

Did you enable the plugin in !jocomment-> other component settigns?

I don't know what you mean. Can you tell me how to enable the plugin? the 'plugin' are just 2 files which have to be pasted into Mamblog, no installer. Funny you ask me, because here you explain it yourself: compojoom.com/index.php/forum.html?func=view&id=16&catid=9#18

I did this:

I made a new setting for com_docman, went into the database and changed it to 'com_mamblog'.

I had to do this workaround because Mamblog is not in the select-box when you make a new 'other components setting'.
Then I got the error because there were no plugin-files for com_mamblog:

string(78) "joomlacomment: unexpected error. No plugin found for component 'com_mamblog' !"

Then I copy-pasted administrator/components/com_comments/plugins/com_content and renamed everthing to com_mamblog.
Then I modified Mamblog to call the 'content'-mambots so it would call the joomlacomment mambot.
And that is where I get stuck.

The bot outputs
<!-- START of joscomment --><!-- END of joscomment -->
at the right place, but thats it. I traced the functions through all the classes and can see the correct functions are being called, but have no idea whats going wrong. no errors, just no output in between the above tags. In com_content there are no problems.

Mamblog plugin frontend does nothing 15 years 8 months ago #615

  • carsten888
  • carsten888's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 46
  • Thank you received: 32
ok, I managed to get joomlacomment to work with Mamblog, but it was not easy and required hacking com_mamblog and com_content.

joomla 1.0.15
joomlacomment 3.26

The only way (I found) to show mamblogs with the comments+editor under it, is by displaying them in com_content. So when blogs are shown in full view thats in com_content.
So what I did was hack all links from mamblog to view items in full and make them go to com_content.
example-link:
index.php?option=com_content&task=view&id=181&Itemid=26

In category-blog-view (in com_mamblog) I inserted some code which produces a 'read more'-link, also linking to com_content. Underneath I inserted code which displays the comment-link. example:
'(3) comments

file:
components/com_mamblog/mamblog.html.php
line:
193
replace the entire function show() with:
function show( $blog, $mask=0, $gid, $option ) {
		global $cfg_mamblog, $Itemid, $my, $mosConfig_live_site;
		$create_date = null;
		if (intval( $blog->created ) <> 0) {
			$create_date = mosFormatDate($blog->created);
		}
		switch (intval($blog->state)) {
			case 0: $state = _BLOG_UNPUBLISHED; break;
			case 1: $state = _BLOG_PUBLISHED; break;
			case -1: $state = _BLOG_ARCHIVED; break;
			default: $state = _BLOG_UNKNOWNSTATE; break;
		}
		$attribs = mosParseParams( $blog->attribs );
		$preset_attribs = mosParseParams( $cfg_mamblog['preset_values']['attribs'] );
 
		?>
<?php if ( $cfg_mamblog['useattribs'] ) { ?>
    <table cellpadding="<?php echo isset( $attribs->border ) ? $attribs->border : $preset_attribs->border; ?>" cellspacing="5" border="0" <?php echo isset( $attribs->width ) ? "width='$attribs->width'" : ""; ?> <?php echo isset( $attribs->height ) ? "height='$attribs->height'" : ""; ?> align="left">
		 <tr>
		 <td valign="top" bgcolor="<?php echo isset( $attribs->bordercolor ) ? $attribs->bordercolor : $preset_attribs->bordercolor; ?>">
<?php } ?>
 
	<table cellpadding="0" cellspacing="5" border="0" width="100%" class="blogs"<?php if ( $cfg_mamblog['useattribs'] ) { ?> style="background-color: <?php echo isset( $attribs->bgcolor ) ? $attribs->bgcolor : $preset_attribs->bgcolor; ?>; color: <?php echo isset( $attribs->fgcolor ) ? $attribs->fgcolor : $preset_attribs->fgcolor; ?>; text-align: <?php echo isset( $attribs->textalign ) ? $attribs->textalign : $preset_attribs->textalign; ?>;" height="<?php echo isset( $attribs->height ) ? $attribs->height : $preset_attribs->height; ?>"<?php } ?>>
		<tr>
			<td width="100%">
			<span class="blog_title">
<?php	
 
global $my, $_MAMBOTS, $row, $params, $page, $database, $action;
 
 
if($blog->access <= $gid ) { 
 
				 $blog->title = Badword::flush($blog->title, $my); 
				 echo '<span class="contentheading" style="display: inline">';
 
				 //truncate string	
				 $blog->title = strip_tags($blog->title);				
					if(strlen($blog->title)>60){						
						$blog->title = substr($blog->title, 0, 59).'...';
					}
				echo $blog->title;
				echo '</span>';				
					} else { 
				$blog->title = Badword::flush($blog->title, $my); 
 
				 $blog->title = strip_tags($blog->title);				 
					if(strlen($blog->title)>60){						
						$blog->title = substr($blog->title, 0, 59).'...';
					}
				echo $blog->title;
					} 
 
 
 
						if ( ( $my->id == $blog->created_by ) && !($mask&MASK_POPUP)) {?>
    <a href="<?php echo sefRelToAbs( "index.php?option=$option&Itemid=$Itemid&task=edit&action=modify&id=$blog->id" ); ?>"><img src="images/M_images/edit.png" width="13" height="14" align="middle" border="0" alt="Edit" /></a>
    <?php	} ?>
	</span>
	<span class="blog_name">
	<a href="<?php echo sefRelToAbs( "index.php?option=$option&Itemid=$Itemid&task=show&action=user&id=$blog->created_by" ); ?>"><?php echo $blog->author; ?></a> - 
	</span>
	<span class="blog_date">
		<?php echo $create_date; ?>
	</span>
            </td>   
		</tr>
<?php	if ( ( $my->id == $blog->created_by ) ) { ?>
		<tr>
			<td class="createdate" colspan="4" align="left"><?php echo  _BLOG_STATE . " " . $state; ?></td>
		</tr>
<?php	} ?>
		<tr>
			<td valign="top" colspan="4" class="blog_text"> <?php 			 
			//truncate string	
			if(strlen($blog->text)>600){
				$blog->text = strip_tags($blog->text);
				$blog->text = substr($blog->text, 0, 599).'...';
			}
			echo $blog->text;			
 
			//read more link
			echo '<p style="margin-top: 5px;"><a href="';	
 
			$menuitem = '26';//menuitem id for general blog-page
			echo sefRelToAbs( "index.php?option=com_content&task=view&id=$blog->id&Itemid=$menuitem" );			
			echo '">lees verder</a></p>';	
 
			//comment link
			$blog_id = $blog->id;
			$database->setQuery("SELECT id FROM jos_comment WHERE contentid='$blog_id'");
			$comments = $database->loadResultArray();
			$number_comments = count($comments);			
			echo '<p><a href="';
			echo sefRelToAbs( "index.php?option=com_content&task=view&id=$blog->id&Itemid=$menuitem#JOSC_TOP" ); 					
			echo '">('.$number_comments.') reacties</a></p>';
 
 
			?>
			 </td>
		</tr>
 
<?php	if ($mask&MASK_READON && trim( $blog->fulltext ) ) { ?>
		<tr>
			<td colspan="3" align="left">
<?php		if($blog->access <= $gid ) { ?>
				<a href="<?php echo sefRelToAbs( "index.php?option=$option&Itemid=$Itemid&task=show&action=view&id=$blog->id&Itemid=$Itemid" ); ?>" class="readon"><?php echo _BLOG_READ_ON;?></a>
 
<?php		} else { ?>
				<a href="<?php echo sefRelToAbs( "index.php?option=com_registration&task=register" ); ?>" class="readon"><?php echo _BLOG_READ_ON_REGISTER;?></a>
<?php		} ?>
			</td>
		</tr>
<?php	} ?>
 
  <?php	if ($mask&MASK_BACKTOLIST) { ?>
  <tr> 
    <td colspan="3" align="center"><!--<a href="javascript:window.history.go(-1);"><?php echo _BACK; ?></a>--></td>
  </tr>
  <?php	} ?>
 
	</table>
 
<?php if ( $cfg_mamblog['useattribs'] ) { ?>
		</td></tr>
	</table>
<?php	} ?>
<?php
	}

and file:
components/com_mamblog/showblogs.php
line:
294
if ( $cfg_mamblog['showarchivelink'] && $type == "user" && intval( $id ) ) {
		echo "<br clear='all' /><a href='" . sefRelToAbs( "index.php?option=$option&Itemid=$Itemid&task=show&action=userarchive&id=$id" ) . "'><strong>" . _BLOG_USERARCHIVE . "</strong></a><br />";
	}
replace with:
if ( $cfg_mamblog['showarchivelink'] && $type == "user" && intval( $id ) ) {		
		$user_id =  mosGetParam( $_REQUEST, 'id', '' );
		if($action=='user' && $my->id!=$user_id){
				$menuitem = '26';//menu-id of genaral blogs-page
			}else{
				$menuitem = '36';//menu-id of users archived blogs		
			}
		echo "<br clear='all' /><a href='" . sefRelToAbs( "index.php?option=$option&Itemid=$menuitem&task=show&action=userarchive&id=$id" ) . "'><strong>" . _BLOG_USERARCHIVE . "</strong></a><br />";
	}

I hacked com_content to show the edit-button for users to edit their blog (linking to com_mamblog).

file:
components/com_content/content.html.php
line:
442
replace the entire function show() with:
function show( &$row, &$params, &$access, $page=0 ) {
		global $mainframe, $hide_js;
		global $mosConfig_live_site;
		global $_MAMBOTS, $task, $database, $my;
 
 
 
 
		$mainframe->appendMetaTag( 'description', 	$row->metadesc );
		$mainframe->appendMetaTag( 'keywords', 		$row->metakey );
 
		// adds mospagebreak heading or title to <site> Title
		if ( isset($row->page_title) && $row->page_title ) {
			$mainframe->setPageTitle( $row->title .' '. $row->page_title );
		}
 
		// calculate Itemid
		HTML_content::_Itemid( $row );
 
		// determines the link and `link text` of the readmore button & linked title
		HTML_content::_linkInfo( $row, $params );
 
		// link used by print button
		$print_link = $mosConfig_live_site. '/index2.php?option=com_content&task=view&id=' . $row->id .'&pop=1&page='. $page . $row->Itemid_link;
 
		// process the new bots
		$_MAMBOTS->loadBotGroup( 'content' );
		$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
 
if ( $access->canEdit ) {
				// edit icon 				
						HTML_content::EditIcon( $row, $params, $access );
 
			}
		$title = $row->title;
		if($title!=''){
 
			if ( $params->get( 'item_title' ) || $params->get( 'pdf' )  || $params->get( 'print' ) || $params->get( 'email' ) ) {
				?>
 
				<table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">
				<tr>
					<?php
					// displays Item Title					
					HTML_content::Title( $row, $params, $access );
					// displays Created Date
					//HTML_content::CreateDate( $row, $params );
 
 
					// displays PDF Icon
					HTML_content::PdfIcon( $row, $params, $hide_js );
 
					// displays Print Icon
					mosHTML::PrintIcon( $row, $params, $hide_js, $print_link );
 
					// displays Email Icon
					HTML_content::EmailIcon( $row, $params, $hide_js );
					?>
				</tr>
				</table>
				<?php
			} 
 
		}//end if when title is shown
 
 
		if ( !$params->get( 'intro_only' ) ) {
			$results = $_MAMBOTS->trigger( 'onAfterDisplayTitle', array( &$row, &$params, $page ) );
			echo trim( implode( "\n", $results ) );
		}
 
		$results = $_MAMBOTS->trigger( 'onBeforeDisplayContent', array( &$row, &$params, $page ) );
		echo trim( implode( "\n", $results ) );
		?>
 
		<table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">
		<?php
		// displays Section & Category
		HTML_content::Section_Category( $row, $params );
 
		// displays Author Name
		HTML_content::Author( $row, $params );
 
		// displays Created Date
		//HTML_content::CreateDate( $row, $params );
 
		// displays Urls
		HTML_content::URL( $row, $params );
		?>
		<tr>
			<td valign="top" colspan="2">
				<?php
				// displays Table of Contents
				HTML_content::TOC( $row );
 
 
 
				// displays Item Text							
 
					echo ampReplace( $row->text );
 
				?>
			</td>
		</tr>
		<?php
 
		// displays Modified Date
		HTML_content::ModifiedDate( $row, $params );
 
		// displays Readmore button
		HTML_content::ReadMore( $row, $params );
 
 
		?>
		</table>
<?php
//trigger bots for event IJoomlaComments		 
		//$results = $_MAMBOTS->trigger( 'IJoomlaComments', array( &$row, &$params, $page ), true );
		//echo trim( implode( "\n", $results ) );
?>
		<span class="article_seperator">&nbsp;</span>
 
		<?php
		$results = $_MAMBOTS->trigger( 'onAfterDisplayContent', array( &$row, &$params, $page ) );
		echo trim( implode( "\n", $results ) );
 
 
 
		// displays the next & previous buttons
		HTML_content::Navigation ( $row, $params );
 
		// displays close button in pop-up window
		mosHTML::CloseButton ( $params, $hide_js );
 
		// displays back button in pop-up window
		mosHTML::BackButton ( $params, $hide_js );
 
 
	}
and in the same file replace the function title() with
function Title( &$row, &$params, &$access ) {
		global $my;
		if ( $params->get( 'item_title' ) ) {
			if ( $params->get( 'link_titles' ) && $row->link_on != '' ) {
				?>
				<td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" >
					<a href="<?php echo $row->link_on;?>" class="contentpagetitle<?php echo $params->get( 'pageclass_sfx' ); ?>">
						<?php echo $row->title;?></a>
					<?php HTML_content::EditIcon( $row, $params, $access ); ?>					
				</td>
				<?php
			} else {
				?>
				<td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" >
					<?php 					 					
					echo $row->title;
					if($row->sectionid==4){
						//display edit icon
						if ($my->id==$row->created_by){					
							echo '<a href="index.php?option=com_mamblog&Itemid=28&task=edit&action=modify&id='.$row->id.'"><img src="images/M_images/edit.png" width="13" height="14" align="middle" border="0" alt="Edit" /></a>';
						}
 
						//display bloggers name
						echo '<span class="blog_name_content">';
						echo '<a href="';
						//$url = sefRelToAbs( "index.php?option=com_comprofiler&task=userProfile&user=$row->created_by&Itemid=31" );links to proflie
						$url = sefRelToAbs( "index.php?option=com_mamblog&Itemid=26&task=show&action=user&id=$row->created_by" ); 
 
						echo $url;
						echo '">';
						$author_id = $row->created_by;
						//get username
						global $database;
						$database->setQuery("SELECT username FROM jos_users WHERE id=$author_id LIMIT 1");
						$author_rows = $database-> loadObjectList();
						$author = $author_rows[0];
						$username = $author->username;		
						echo $username;
						echo '</a> -</span>';
					}else{
						echo '&nbsp;&nbsp;';
					}
					echo '<span class="creation_date">';
					//HTML_content::CreateDate( $row, $params );
					echo mosFormatDate( $row->created );					
					echo '</span>';
					?>
					<?php //HTML_content::EditIcon( $row, $params, $access ); ?>
				</td>
				<?php
			}
		} else {
			?>
			<td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" >
				<?php //HTML_content::EditIcon( $row, $params, $access ); ?>
			</td>
			<?php
		}
	}

note that in this code the date is display right next to the items' title. You might want to rip that out.

Then I switched the 'read more' and comment-link around using this hack
compojoom.com/index.php/forum.html?func=...&id=611&start=10#611

Mamblog plugin frontend does nothing 15 years 8 months ago #617

  • carsten888
  • carsten888's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 46
  • Thank you received: 32
wow! that post realy broke the layout. (overflow: scroll should fix that).
anyway, I hope that helps.
:)
  • Page:
  • 1
Time to create page: 0.178 seconds