1
lukeon
Re: DMS - Problems retrieving word / office document (encoding)
  • 2008/9/9 12:31

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


It's intranet so unfortunatelly no link

DMS Document Management System v 1.91
PHP Version 5.2.5
MySql Server version: 5.0.51a



2
lukeon
Re: DMS - Problems retrieving word / office document (encoding)
  • 2008/9/2 6:54

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


Really no one can help??



3
lukeon
DMS - Problems retrieving word / office document (encoding)
  • 2008/8/28 9:32

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


Hi!

I have a DMS problem! Pdf's work perfect but after uploading word document (.doc) I get problems retrieving it.

MS Word wants to convert it to some format (long list, but there are ex. Coded text, RTF, html, word 97 etc)
Unfortunately non of the converting works, from a simple one page document I get a 40 page document mostly blank with some strange characters.

I use Office XP and IE 7 can it be a problem of compatibility?

Thanks for help!



4
lukeon
Re: xlanguage: more content in one language than other
  • 2008/6/18 9:09

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


thank you kerkyra!

I will try your solution when I'm back from holiday (beg. of July)
now unfortunately have no time to play with this :(

hej Dona_Brasil

thanks for suggestions, but it's an intranet service I'm building so search engines are no concern :) (argument 2)
And I wouldn't like to end up in having several different intranets depending on the language. The thing is that most "stuff" will be only in english (available for everyone) some stuff will be translated (to swedish and polish) as it is today (in a pdf file:) and some content will be in local languages only (available only for locals)

thank very much you for support and hear you soon!



5
lukeon
Re: xlanguage: more content in one language than other
  • 2008/6/12 14:48

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


i have just folder in the url, so i guess it will be index.php, here it is:

<?php
// $Id: index.php,v 1.15 2004/05/25 10:53:08 mithyt2 Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
// ------------------------------------------------------------------------- //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include '../../mainfile.php';

include_once 
XOOPS_ROOT_PATH.'/modules/AMS/class/class.newsstory.php';

if (isset(
$_GET['storytopic'])) {
    
$xoopsOption['storytopic'] = intval($_GET['storytopic']);
} else {
    
$xoopsOption['storytopic'] = 0;
}
if ( isset(
$_GET['storynum']) ) {
    
$xoopsOption['storynum'] = intval($_GET['storynum']);
    if (
$xoopsOption['storynum'] > $xoopsModuleConfig['max_items']) {
        
$xoopsOption['storynum'] = $xoopsModuleConfig['max_items'];
    }
} elseif (
$xoopsOption['storytopic'] > 0) {
    
$xoopsOption['storynum'] = $xoopsModuleConfig['storyhome_topic'];
}
else {
    
$xoopsOption['storynum'] = $xoopsModuleConfig['storyhome'];
}

if ( isset(
$_GET['start']) ) {
    
$start intval($_GET['start']);
} else {
    
$start 0;
}
if (empty(
$xoopsModuleConfig['newsdisplay']) || $xoopsModuleConfig['newsdisplay'] == 'Classic' || $xoopsOption['storytopic'] > 0) {
    
$showclassic 1;
}
else {
    
$showclassic 0;
}

$myts =& MyTextSanitizer::getInstance();
$pagetitle $myts->makeTboxData4Show($xoopsModule->name());
$column_count $xoopsModuleConfig['columnmode'];
if (
$showclassic) {
    
$xoopsOption['template_main'] = 'ams_index.html';
}
else {
     
$xoopsOption['template_main'] = 'ams_by_topic.html';
}
include 
XOOPS_ROOT_PATH.'/header.php';
$xoopsTpl->assign('columnwidth'intval(1/$column_count*100));
if (
$xoopsModuleConfig['displaynav'] == ) {
    
$xoopsTpl->assign('displaynav'true);
    
$xt = new AmsTopic($xoopsDB->prefix('ams_topics'));
    
$allTopics $xt->getAllTopics(true);
    include_once(
XOOPS_ROOT_PATH."/class/tree.php");
    include_once(
XOOPS_ROOT_PATH."/class/xoopsformloader.php");
    
$topic_tree = new XoopsObjectTree($allTopics'topic_id''topic_pid');
    
$topic_select_code $topic_tree->makeSelBox('storytopic''topic_title''-'$xoopsOption['storytopic'], true);
    
$topic_form = new XoopsThemeForm(''"topic_form""index.php""get");
    
$topic_form->addElement(new XoopsFormLabel(''$topic_select_code));
    
// Make number options
    
$i 1;
    while (
$i <= $xoopsModuleConfig['max_items']) {
        
$options[$i] = $i;
        if (
$i == 1) {
            
$i 5;
        }
        else {
            
$i $i 5;
        }
    }
    
$storynum_select = new XoopsFormSelect('''storynum'$xoopsOption['storynum']);
    
$storynum_select->addOptionArray($options);

    
$submit_btn = new XoopsFormButton('''submit'_GO'submit');

    
$topic_form->addElement($storynum_select);
    
$topic_form->addElement($submit_btn);
    
$topic_form->assign($xoopsTpl);
}
else {
    
$xoopsTpl->assign('displaynav'false);
}
if (
$showclassic) {
    
$ihome $xoopsOption['storytopic'] > 0;

    
$sarray AmsStory::getAllPublished($xoopsOption['storynum'], $start$xoopsModuleConfig['restrictindex'], $xoopsOption['storytopic'], $ihome);

    
$scount count($sarray);
    
$xoopsTpl->assign('story_count'$scount);
    if (
$scount 0) {
        
$uids = array();
        foreach (
$sarray as $storyid => $thisstory) {
            
$uids[$thisstory->uid()] = $thisstory->uid();
        }
        
$member_handler =& xoops_gethandler('member');
        
$user_arr $member_handler->getUsers(new Criteria('uid'"(".implode(','array_keys($uids)).")"'IN') , true);
        foreach (
$sarray as $storyid => $thisstory) {
            
$stories[] = $thisstory->toArray(falsefalse0$user_arr);
        }
        
$xoopsTpl->assign('stories'$stories);
    }
    else {
        
$xoopsTpl->assign('stories', array());
    }
    
$xoopsTpl->assign('columns'$column_count);

    
$totalcount AmsStory::countPublishedByTopic($xoopsOption['storytopic'], $xoopsModuleConfig['restrictindex']);
    if ( 
$totalcount $scount ) {
        include_once 
XOOPS_ROOT_PATH.'/class/pagenav.php';
        
$pagenav = new XoopsPageNav($totalcount$xoopsOption['storynum'], $start'start''storytopic='.$xoopsOption['storytopic']);
        
$xoopsTpl->assign('pagenav'$pagenav->renderNav());
    }
    else {
        
$xoopsTpl->assign('pagenav''');
    }

    if(
$xoopsOption['storytopic'] > 0)
    {
        if (!isset(
$xt)) {
            
$xt = new AmsTopic($xoopsDB->prefix('ams_topics'));
        }
        
$xt->getTopic($xoopsOption['storytopic']);
        
$pagetitle .= ' - ' $xt->topic_title();
        
$xoopsTpl->assign('breadcrumb'$xt->getTopicPath());
    }
    else {
        
$xoopsTpl->assign('breadcrumb''');
    }
}
else {
    include_once(
XOOPS_ROOT_PATH."/class/tree.php");
    
$xt = new AmsTopic($xoopsDB -> prefix("ams_topics"));
    
$allTopics $xt->getAllTopics($xoopsModuleConfig['restrictindex']);
    
$topic_obj_tree = new XoopsObjectTree($allTopics'topic_id''topic_pid');
    
$alltopics $topic_obj_tree->getFirstChild(0);
    
    
$article_counts AmsStory::countPublishedOrderedByTopic();
    
    
$smarty_topics = array();
    foreach (
array_keys($alltopics) as $i) {
        
$allstories[$i] = AmsStory::getAllPublished($xoopsOption['storynum'], 0false$i0);
        if (
count($allstories[$i]) > 0) {
            foreach (
$allstories[$i] as $thisstory) {
                
$uids[$thisstory->uid()] = $thisstory->uid();
            }
        }
        if (!isset(
$article_counts[$i])) {
            
$article_counts[$i] = 0;
        }
    }
    if (
count($uids) > 0) {
        
$member_handler =& xoops_gethandler('member');
        
$user_arr $member_handler->getUsers(new Criteria('uid'"(".implode(','array_keys($uids)).")"'IN') , true);
        foreach (
$alltopics as $topicid => $topic) {
            
$topicstories = array();
            foreach (
$allstories[$topicid] as $thisstory) {
                
$topicstories[] = $thisstory->toArray(falsefalse0$user_arr);
            }
            
$subcount 0;
            
$subs = array();
            
//$key = findKey($smarty_topics, $topicstories[0]['posttimestamp']);
            
$subtopics $topic_obj_tree->getFirstChild($topicid);
            
$subcount count($subtopics);
            foreach (
array_keys($subtopics) as $i) {
                
$subs[$i] = array('id' => $i'title' => $subtopics[$i]->topic_title(), 'imageurl' => $subtopics[$i]->topic_imgurl());
            }
            
$smarty_topics[] = array('title' => $topic->topic_title(), 'stories' => $topicstories'id' => $topicid'subtopics' => $subs'articlecount' => $article_counts[$topicid], 'subtopiccount' => $subcount);
            unset(
$subs);
        }
    }
    
//krsort($smarty_topics);
    
$xoopsTpl->assign('topics'$smarty_topics);
    
$xoopsTpl->assign('columns'$column_count);
    
$xoopsTpl->assign('breadcrumb''');
}
if (
XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
    
$showcomments 1;
}
else {
    
$showcomments 0;
}
$xoopsTpl->assign('showcomments'$showcomments);
$xoopsTpl->assign('xoops_pagetitle'$pagetitle);
$xoopsTpl->assign('lang_go'_GO);
$xoopsTpl->assign('lang_on'_ON);
$xoopsTpl->assign('lang_printerpage'_AMS_NW_PRINTERFRIENDLY);
$xoopsTpl->assign('lang_sendstory'_AMS_NW_SENDSTORY);
$xoopsTpl->assign('lang_postedby'_POSTEDBY);
$xoopsTpl->assign('lang_reads'_READS);
$xoopsTpl->assign('lang_morereleases'_AMS_NW_MORERELEASES);
if (
$xoopsOption['storytopic'] > 0) {
    
$topic = new AmsTopic($xoopsDB->prefix('ams_topics'), $xoopsOption['storytopic']);
    
$xoopsTpl->assign('topicbanner'$myts->displayTarea($topic->getBanner(), 1));
}
include_once 
XOOPS_ROOT_PATH.'/footer.php';


function 
findKey($array$suggested_key) {
    if (isset(
$array[$suggested_key])) {
        return 
findKey($array$suggested_key +);
    }
    return 
$suggested_key;
}
?>



6
lukeon
Re: xlanguage: more content in one language than other
  • 2008/6/12 11:54

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


I use AMS for news section, and the query you were talking about is in the file
.....modules\AMS\class\class.newsstory.php

below is a part of its code which i guess I need to modifiy (i copied it from line 32 to line 213)

The columns that contain language tags in DB are 'hometext' and 'bodytext' from table xoops_ams_text
and 'title' from table xoops_ams_article

I think i need to modify the function getAllPublished (line 166) the way you told me, but i cant find variables that hold my data.

please give me some hint:)

include_once XOOPS_ROOT_PATH."/class/xoopsstory.php";
include_once 
XOOPS_ROOT_PATH."/modules/AMS/class/class.newstopic.php";
include_once 
XOOPS_ROOT_PATH.'/include/comment_constants.php';


class 
AmsStory extends XoopsStory
{
    var 
$newstopic;   // XoopsTopic object
    
var $change;
    var 
$version;
    var 
$revision;
    var 
$revisionminor;
    var 
$current;
    var 
$texttable;
    var 
$ratings//individual ratings
    
var $rating//average rating
    
var $updated//Last update
    
var $_errors=array(); //errors encountered
    
var $isNew false;
    var 
$versionConflict false;
    var 
$banner;
    var 
$VersionNo;
    var 
$audienceid;
    var 
$audience;
    var 
$audiencetable;
    var 
$_hasVersions = -1;
    var 
$uname "";

    function 
AmsStory($storyid=-1$getRating false)
    {
        
$this->db =& Database::getInstance();
        
$this->table $this->db->prefix("ams_article");
        
$this->texttable $this->db->prefix("ams_text");
        
$this->topicstable $this->db->prefix("ams_topics");
        
$this->audiencetable $this->db->prefix("ams_audience");
        if (
is_array($storyid)) {
            
$this->makeStory($storyid);
            
$this->newstopic $this->topic();
        } elseif(
$storyid != -1) {
            
$this->getStory(intval($storyid));
            
$this->newstopic $this->topic(true);
            if (
$getRating != false) {
                
$this->getRatings();
            }
        }
        else {
            
$this->isNew true;
        }
    }

    function 
topic($single_topic false)
    {
        if (!
$this->newstopic) {
            if (
false == $single_topic) {
                
$topics AmsTopic::getAllTopics();
                
$this->newstopic $topics[$this->topicid()];
            }
            else {
                
$this->newstopic = new AmsTopic($this->topicstable$this->topicid());
            }
        }
        return 
$this->newstopic;
    }

    function 
getStory($storyid)
    {
        
$sql "SELECT * FROM ".$this->table." n, ".$this->texttable." t, ".$this->audiencetable." a WHERE n.storyid=t.storyid AND n.audienceid=a.audienceid AND t.current=1 AND n.storyid=".$storyid."";
        
$array $this->db->fetchArray($this->db->query($sql));
        
$this->makeStory($array);
    }

    function 
hometext($format="Show")
    {
        
$myts =& MyTextSanitizer::getInstance();
        
$html 1;
        
$smiley 1;
        
$xcodes 1;
        if ( 
$this->nohtml() ) {
            
$html 0;
        }
        if ( 
$this->nosmiley() ) {
            
$smiley 0;
        }
        switch ( 
$format ) {
            case 
"Show":
            
$hometext $myts->displayTarea($this->hometext,$html,$smiley,$xcodes);
            break;
            case 
"Edit":
            
$hometext $myts->htmlSpecialChars($this->hometext);
            break;
            case 
"Preview":
            
$hometext $myts->previewTarea($this->hometext,$html,$smiley,$xcodes);
            break;
            case 
"InForm":
            
$hometext $myts->htmlSpecialChars$myts->stripSlashesGPC($this->hometext));
            break;
            case 
"N":
            
$hometext stripslashes($this->hometext);
            break;
        }
        return 
$hometext;
    }

    function 
bodytext($format="Show")
    {
        
$myts =& MyTextSanitizer::getInstance();
        
$html 1;
        
$smiley 1;
        
$xcodes 1;
        if ( 
$this->nohtml() ) {
            
$html 0;
        }
        if ( 
$this->nosmiley() ) {
            
$smiley 0;
        }
        switch ( 
$format ) {
            case 
"Show":
            
$bodytext $myts->displayTarea($this->bodytext,$html,$smiley,$xcodes);
            break;
            case 
"Edit":
            
$bodytext $myts->htmlSpecialChars($this->bodytext);
            break;
            case 
"Preview":
            
$bodytext $myts->previewTarea($this->bodytext,$html,$smiley$xcodes);
            break;
            case 
"InForm":
            
$bodytext $myts->htmlSpecialChars($myts->stripSlashesGPC($this->bodytext));
            break;
            case 
"N":
            
$bodytext stripslashes($this->bodytext);
            break;
        }
        return 
$bodytext;
    }

    function 
getAllPublished($limit=0$start=0$checkRight false$topic=0$ihome=0$asobject=true$order 'published'$ids false)
    {
        
$db =& Database::getInstance();
        
$myts =& MyTextSanitizer::getInstance();
        
$ret = array();
        
$sql "SELECT * FROM ".$db->prefix("ams_article")." n, ".$db->prefix("ams_text")." t, ".$db->prefix("ams_audience")." a WHERE t.storyid=n.storyid AND n.audienceid=a.audienceid AND published > 0 AND published <= ".time()." AND (expired = 0 OR expired > ".time().")";
        if ( 
$topic != ) {
            if (!
is_array($topic)) {
                
$sql .= " AND topicid=".intval($topic)." AND (ihome=1 OR ihome=0)";
            }
            else {
                
$sql .= " AND topicid IN (".implode(','$topic).")";
            }
        } else {
            if (
$checkRight) {
                global 
$xoopsUser$xoopsModule;
                if (!isset(
$xoopsModule) || $xoopsModule->getVar('dirname') != "AMS") {
                    
$module_handler =& xoops_gethandler('module');
                    
$newsModule =& $module_handler->getByDirname('AMS');
                }
                else {
                    
$newsModule =& $xoopsModule;
                }
                
$groups $xoopsUser $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
                
$gperm_handler =& xoops_gethandler('groupperm');
                
$topics $gperm_handler->getItemIds('ams_view'$groups$newsModule->getVar('mid'));
                
$topics implode(','$topics);
                
$sql .= " AND topicid IN (".$topics.")";
            }
            if ( 
$ihome == ) {
                
$sql .= " AND ihome=0";
            }
        }
        if (
$ids != false) {
            
$sql .= " AND n.storyid NOT IN (".implode(','$ids).")";
        }
        
$sql .= " AND t.current=1";
        
$sql .= " ORDER BY $order DESC";
        
$result $db->query($sql,intval($limit),intval($start));
        while ( 
$myrow $db->fetchArray($result) ) {
            if ( 
$asobject ) {
                
$ret[] = new AmsStory($myrow);
            } else {
                
$ret[$myrow['storyid']] = $myts->makeTboxData4Show($myrow['title']);
            }
        }
        return 
$ret;
    }



7
lukeon
Re: xlanguage: more content in one language than other
  • 2008/6/11 8:51

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


Hej kerkyra!

Thank you for your help. But I'm sort of beginer with all this. Can you explain it more in "for a dummy" style;)

to create a file in include folder, that I can do (lets tell it will have name: langcheck.php)

to include it, i should have a line like this:
include "langcheck.php";

right?
But where should I cinclude this?

Ant the hardest part: Quote:
all you have to do is query the db and hold the content in a variable without sanitising it

this I don't know how to do :(

Where do i insert the code you have provided? in witch file?
how do i call it (execute the querry)

please give me some more advice:)

Thank you for your support.

Just so you know I was experimenting with user groups (ex. swedish users) and view permission settings, but they seem not to work:( I want to try your idea (will reduce the administration fuss with more user groups)



8
lukeon
Re: Search results not grouped by module
  • 2008/6/11 7:54

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


trabis thanks for this module!

search works very nice.

but I have problems with AJAX function, how can I make it work, is there a special setting?

now I just see the circle running (ajax search) and a tip text "working ..." but so far no Ajax results :(



9
lukeon
Search results not grouped by module
  • 2008/6/10 12:25

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


Hi!

I've read it once while ago, but cant find the post now.

How do i change search results page to see results not sorted by module, but sort of google like list (ex. most recent first).

with first couple of modules returning
"No Match Found for your Query"

some users miss that there are results in other modules.



10
lukeon
Re: xlanguage: more content in one language than other
  • 2008/6/9 10:06

  • lukeon

  • Just popping in

  • Posts: 17

  • Since: 2008/4/2 6


Yes I thought about that.

It solves the problem when I have a basic language (english) and some articles translated (swedish)

so i tag only the swedish text and put it on the top.


But I was wondering if there is something I can do when the article is only in swedish (for swedish readers only)

Thanks kerkyra!




TopTop
(1) 2 »



Login

Who's Online

304 user(s) are online (199 user(s) are browsing Support Forums)


Members: 0


Guests: 304


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