21
nick89
Re: Writing or copying xoops code into another block don't work?
  • 2004/7/18 8:45

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


this dosen't help the fact that smarty isn't parsed any way. why not add a block onto the end of the system module by editing its xoops_version.php file.



22
nick89
Re: Writing or copying xoops code into another block don't work?
  • 2004/7/18 8:39

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


you code is horrible : now lets sort some of this out:
<{if $block.view_popup == true}><{/if}>

The above line is redundant your asking it using if however nothing executes because there is nothing before its corosponding <{/if}>



<
a target="_blank" href="<{$block.user_link}>"><{if $block.is_avatar}><img src="{$block.avatar}"><{/if}><br>

You have {$block.avatarin your codealways have the entire delimeters <{ and }> - so it is <{$block.avatar}>




23
nick89
Re: New mods don't show up to be installed..
  • 2004/7/18 8:24

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


interesting.. are you sure you copied everything?



24
nick89
Re: page not found
  • 2004/7/18 8:21

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


I think it ust be something to do with your news module - give the news prefs a once over.



25
nick89
Re: page not found
  • 2004/7/18 7:46

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


neither worked for me. Strangely enough though I only got a 404 once it tried to start your news module, the root directory however works fine.



26
nick89
Re: Truncating text of users news posts
  • 2004/7/18 7:35

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


and does that function ignore formatting when getting a substring?



27
nick89
Re: Truncating text of users news posts
  • 2004/7/18 1:52

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


how does XOOPS handle formatting - would I have to do some sort of strip tags before substring?



28
nick89
Re: Truncating text of users news posts
  • 2004/7/18 1:48

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


here is my attempt
if(strlen($message) < 30){
$story->setHometext($message);
}else{
$story->setHometext(substr($message,0,30).'...');
}

will this work?



29
nick89
Re: Truncating text of users news posts
  • 2004/7/18 1:41

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


my php knowledge isn't very good - maybee someone would be nice enough to rewrite the $story->setHometext(substr($message,0,30).'...');

so that it checks it is longer than 30 chars before truncating it?



30
nick89
Re: Truncating text of users news posts
  • 2004/7/18 1:37

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


After a bit more research i have found the best way. Editting submit.php:

Here is the store process:
$story = new NewsStory();
    
$story->setTitle($subject);
    
$story->setHometext($message);
    
$story->setUid($uid);
    
$story->setTopicId($topic_id);
    
$story->setHostname(xoops_getenv('REMOTE_ADDR'));
    
$story->setNohtml($nohtml_db);
    
$nosmiley = isset($nosmiley) ? intval($nosmiley) : 0;
    
$notifypub = isset($notifypub) ? intval($notifypub) : 0;
    
$story->setNosmiley($nosmiley);
    
$story->setNotifyPub($notifypub);
    
$story->setType('user');
    if ( 
$xoopsModuleConfig['autoapprove'] == ) {
        
$approve 1;
        
$story->setApproved($approve);
        
$story->setPublished(time());
        
$story->setExpired(0);
        
$story->setTopicalign('R');
    }
    
$result $story->store();


Now the bit $story->setHometext($message);
can be changed to
$story->setBodytext($message);
then you can add
$story->setHometext(substr($message,0,30).'...');
(i haven't completely worked this out, will substr complain if the string is less than 30 chars? and this will still add the ... to messages less than 30 chars.




TopTop
« 1 2 (3) 4 »



Login

Who's Online

186 user(s) are online (118 user(s) are browsing Support Forums)


Members: 0


Guests: 186


more...

Donat-O-Meter

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

Latest GitHub Commits