21
Kieran
Re: system_block_comments.html change
  • 2007/10/12 10:51

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


Hi there,

This is exactly what I want to do (actually just need to add the users avatar to each comment).

I've copied the above but it doesn't work - tried to figure out why but can't

Here's my code

Template:
Quote:
<table width="100%" cellspacing="1" class="outer">
<{foreach item=comment from=$block.comments}>
<tr class="neweven">
<td align="left"><img src="<{$comment.poster.avatar}>" /><{$comment.title}> Posted by <{$comment.poster}>
</td>
</tr>
<{/foreach}>
</table>


Systems Block:
Quote:

function b_system_comments_show($options)
{
$block = array();
include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
$comment_handler =& xoops_gethandler('comment');
$criteria = new CriteriaCompo(new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
$criteria->setLimit(intval($options[0]));
$criteria->setSort('com_created');
$criteria->setOrder('DESC');
$comments = $comment_handler->getObjects($criteria, true);
$member_handler =& xoops_gethandler('member');
$module_handler =& xoops_gethandler('module');
$modules = $module_handler->getObjects(new Criteria('hascomments', 1), true);
$comment_config = array();
foreach (array_keys($comments) as $i) {
$mid = $comments[$i]->getVar('com_modid');
$com['module'] = '<a href="'.XOOPS_URL.'/modules/'.$modules[$mid]->getVar('dirname').'/">'.$modules[$mid]->getVar('name').'</a>';
if (!isset($comment_config[$mid])) {
$comment_config[$mid] = $modules[$mid]->getInfo('comments');
}
$com['id'] = $i;
$com['title'] = '<a href="'.XOOPS_URL.'/modules/'.$modules[$mid]->getVar('dirname').'/'.$comment_config[$mid]['pageName'].'?'.$comment_config[$mid]['itemName'].'='.$comments[$i]->getVar('com_itemid').'&com_id='.$i.'&com_rootid='.$comments[$i]->getVar('com_rootid').'&'.htmlspecialchars($comments[$i]->getVar('com_exparams')).'#comment'.$i.'">'.$comments[$i]->getVar('com_title').'</a>';
$com['text'] = $comments[$i]->getVar('com_text');
$com['icon'] = htmlspecialchars( $comments[$i]->getVar('com_icon'), ENT_QUOTES );
$com['icon'] = ($com['icon'] != '') ? $com['icon'] : 'icon1.gif';
$com['time'] = formatTimestamp($comments[$i]->getVar('com_created'),'m');
if ($comments[$i]->getVar('com_uid') > 0) {
$com['poster'] = array();
$poster =& $member_handler->getUser($comments[$i]->getVar('com_uid'));
if (is_object($poster)) {
$com['poster']['link'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$comments[$i]->getVar('com_uid').'">'.$poster->getVar('uname').'</a>';
$com['poster']['id'] = $comments[$i]->getVar('com_uid');
$com['poster']['uname'] = $poster->getVar('uname');
$com['poster']['avatar'] = '<img src="'.XOOPS_URL.'/uploads/'.$poster->getVar('user_avatar').'" />';
} else {
$com['poster']['link'] = $GLOBALS['xoopsConfig']['anonymous'];
}
} else {
$com['poster']['link'] = $GLOBALS['xoopsConfig']['anonymous'];
}
$block['comments'][] =& $com;
unset($com);
}
return $block;
}


Thanks for any help



22
Kieran
Re: Iframes: can I exlude page header & side columns?
  • 2007/9/29 6:37

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


I'm running XOOPS 2.0.16, the debug returned no errors on theme changer.

I'm php 4.3.11 and its theme changer 2.6

My new smartsection module (lets call it smartsection2) displays all the articles from the original smartsection perfectly. My approach is probably pretty clumsy though. Here's what i did: I cloned the module, called it smartsection2, installed it but then replaced the files item.php, footer.php and header.php with the ones from the original smartsection module.

This means that the new module now can display the original articles which is all I want. Of course it means that the rest of the module doesn't work, I can't visit the index page for example because I've changed the header and footer but for my purpose that doesn't matter - I just wanna be able to display the articles in a second module so that I can change the theme of that module so that it has only the central content, allowing it to be displayed on other websites via the use of iframes (with me???)

I need to access the original articles rather than duplicate because articles are constantly being amended/added.

I think (!!!!) I'll be ok in terms of Google and duplication because the sites that display my content will do so via a search feature which I think I'm right in saying Google's bot won't follow - so it will never find these copies of the articles

If anybody is still with me at this point, thanks a lot for paying attention

Having explained all that I think the problem is with theme changer because as I said the articles display fine in the cloned module and if I change the theme via the site-wide control I get the exact effect I'm looking for.

Any ideas??

Thanks again!



23
Kieran
Re: Iframes: can I exlude page header & side columns?
  • 2007/9/28 10:32

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


Hi there

It works! But there is one problem I can't get theme changer to work. Its installed and seems to be ok, I can edit the theme change that I want to make, theme changer tells me its gone ok but when I go to the module its still displaying as my site-wide theme

I wonder, am I missing something obvious for making theme changer work? There is a read me file but it is in Japanese!!!



24
Kieran
Re: Iframes: can I exlude page header & side columns?
  • 2007/9/27 9:12

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


Hi Jeff

Would it be possible to do it this way or am I way off the mark?

Install smartsection a second time (but rename it - which is easy to do with this module). Let's say I call this second version smartsection2. I would then go through all the relevant files to find and replace the new module name (smartsection2) with the original module name (smartsection). Thus smartsection2 would also be accessing the smartsection tables where all my articles are kept but I would use the theme changer on this new module to display it without the sides/header/footer.

Would this work or is totally not possible?

Cheers



25
Kieran
Re: Iframes: can I exlude page header & side columns?
  • 2007/9/26 8:47

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


Thanks a lot!

The tutorial is great, but am I right in thinking that it will only work on modules that use the simplified theme?

I want to use iframes to show my news stories on other websites but they still need to be displayed on my site as well. So for that module I still need to use my site-wide theme.

Does that mean this solution won't work?

I'm probably being thick but how would I work the RSS feeds solution?

Thanks again



26
Kieran
Iframes: can I exlude page header & side columns?
  • 2007/9/25 6:03

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


Hi there,

Is it possible to show only the central column of a page?

I need to do this because I want to offer my content to other websites, allowing them to use my content through the use of iframes.

But for this to work the included page must only show the article in the middle of the page (and exclude the side bars and the header and the footer).

Does anybody know if this is possible in xoops

Thanks for any help!



27
Kieran
Re: Custom Block include: can it change language?
  • 2007/8/6 9:44

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


Thanks Jim, that did it!



28
Kieran
Re: Custom Block include: can it change language?
  • 2007/8/3 11:17

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


I think I didn't explain this very well!!

My question is:

Is it possible to have the included content of a custom block(php) change language as the rest of the page does (using xlanguage).

Cheers!!!



29
Kieran
Custom Block include: can it change language?
  • 2007/7/30 23:24

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


I'm using the myiframe module to include a page in my homepage. My site uses Xlanguage.

For visitors from China who arrive at the site it automatically displays the Chinese version, otherwise its English.

But the included block does not vary

I'm wondering if there is a php "if" statement I can use to have the included php block also upload the correct html page (Chinese or English)

Right now the inlcude is:

include_once XOOPS_ROOT_PATH . '/modules/myiframe/blocks/myiframe_iframe.php';
b_myiframe_iframe_onthefly(1);

Or perhaps another way of doing it???? Thanks!!!



30
Kieran
Word Press making changes to Recent Comments Block
  • 2007/7/24 13:11

  • Kieran

  • Just popping in

  • Posts: 32

  • Since: 2007/7/12


Hi, there! I kind of think this is a simple problem but I just can't figure it out (or find the answer).

The 'Recent Comments' Block for Xpress has the author title before the comment and I want to remove the author name so that the link is only a teaser of the comment.

Anybody know how to do this?

BTW I'm taking about the recent comments block that can appear on all XOOPS pages - not the recent comments listed on the WordPress side bar.

Thanks for any suggestions!




TopTop
« 1 2 (3) 4 »



Login

Who's Online

229 user(s) are online (148 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits