Bandit-X.Net  
ID Password

Browsing this Thread:   2 Anonymous Users


 Bottom   Previous Topic   Next Topic  Topic is Locked

« 1 (2) 3 »


Re: XM-Spotlight 1.02 In The Works.
Just popping in
Joined:
2006/10/11 16:50
Posts: 4
Offline
Thanks for your answer bandit

Quote:
i think. and the category -subcategory function is not in the module yet.


First, I´m not a coder, so please be patient

How dificult would be to pull those features from the news mod?

I´m asking you about that cauz I´m needing that function for a project and any code snippet (even hardcoded) would be great bandit.

Thanks,
Wilson

Posted on: 2006/10/12 9:59
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Webmaster
Joined:
2006/6/3 9:27
From UsA - MiChIgAn
Posts: 154
Offline
im not really sure. im actually kinda new to php and mysql.

Posted on: 2006/10/12 18:22
_________________
Bandit-X.Net
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Webmaster
Joined:
2006/6/3 9:27
From UsA - MiChIgAn
Posts: 154
Offline
well i got the subcategory thing working. but i had to edit one of the news function in the newsstory. so i gotta figure out how i'll get this released with the XM-Spotlight Module.

added'
option for show/hide date
custom date
show sub-category checkbox

no download until after i figure out how i'll release the next build

Posted on: 2006/10/15 20:01
_________________
Bandit-X.Net
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Just popping in
Joined:
2006/10/11 16:50
Posts: 4
Offline
Hi Bandit

Great news

I´ll be tuned waiting

Thanks

Posted on: 2006/10/15 21:12
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Webmaster
Joined:
2006/6/3 9:27
From UsA - MiChIgAn
Posts: 154
Offline
i was planning on releasing something today, but lately i've been a bit busy looking for something for my dish.

well here is some code from a modified getAllPublished function from 'class/class.newsstory.php', when subs is true. the function looks in the database for the categories with the 'parent id' with the 'topic_id' ($topic) that is passed . but it only goes 1 deep at the moment. this funtion is is not fully tested yet.
function getAllPublishedMore($limit=0, $start=0, $checkRight=false, $topic=0, $ihome=0, $asobject=true, $order = 'published', $topic_frontpage=false, $subs = false)
{
	$db =& Database::getInstance();
	$myts =& MyTextSanitizer::getInstance();
	$ret = array();
	
	//if subs is true
	if ($subs == True){
		$sqlz = "SELECT topic_id FROM ".$db->prefix('topics')." WHERE (topic_pid=".$topic.")";
		$resultz = $db->query($sqlz);
		$critadd ='';
		while ( $topicz = $db->fetchArray($resultz) ) {
        $critadd .= " OR topicid=".$topicz['topic_id']." ";

    }        
   $critadd .= ")";
  }elseif ($subs == False){
    //if subs is false
	  }
		
  $sql = "SELECT s.*, t.* FROM ".$db->prefix("stories")." s, ". $db->prefix("topics")." t WHERE (published > 0 AND published <= ".time().") AND (expired = 0 OR expired > ".time().") AND (s.topicid=t.topic_id) ";
  if ($topic != 0) {
	    if (!is_array($topic)) {
	    	if($checkRight) {
      			$topics = MygetItemIds('news_view');
	    		if(!in_array ($topic,$topics)) {
	    			return null;
	    		} else {
	    			$sql .= " AND (topicid=".intval($topic)." ".$critadd." AND (ihome=1 OR ihome=0)";
	    		}
	    	} else {
	        	$sql .= " AND topicid=".intval($topic)." AND (ihome=1 OR ihome=0)";
	        }
	    } else {
			if($checkRight) {
				$topics = MygetItemIds('news_view');
	    		$topic = array_intersect($topic,$topics);
	    	}
	    	if(count($topic)>0) {
	        	$sql .= " AND topicid IN (".implode(',', $topic).")";
	    	} else {
	    		return null;
	    	}
	    }
	} else {
	    if($checkRight) {
	        $topics = MygetItemIds('news_view');
	        if(count($topics)>0) {
	        	$topics = implode(',', $topics);
	        	$sql .= " AND topicid IN (".$topics.")";
	        } else {
	        	return null;
	        }
	    }
		if (intval($ihome) == 0) {
			$sql .= " AND ihome=0";
		}
	}
	if($topic_frontpage) {
		$sql .=" AND t.topic_frontpage=1";
	}
	$sql .= " ORDER BY s.$order DESC";
	$result = $db->query($sql,intval($limit),intval($start));

	while ( $myrow = $db->fetchArray($result) ) {
		if ($asobject) {
			$ret[] = new NewsStory($myrow);
		} else {
			$ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
		}
	}

	return $ret;
}

Posted on: 2006/10/20 11:56

Edited by Bandit-X on 2006/10/20 12:22:15
_________________
Bandit-X.Net
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Just popping in
Joined:
2006/10/11 16:50
Posts: 4
Offline
Hi Bandit

Quote:
but lately i've been a bit busy looking for something for my dish


How about a nice tbone steak

So let me understand....
Than function is a News 1.44 native one?

Do you think It´ll be impossible to just push the subs from the xmospotligh only?

As you know I´m not a coder but I´ll try to help to get that function working nice

Posted on: 2006/10/20 13:40
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Webmaster
Joined:
2006/6/3 9:27
From UsA - MiChIgAn
Posts: 154
Offline
Quote:

wilson wrote:

So let me understand....
Than function is a News 1.44 native one?

Do you think It´ll be impossible to just push the subs from the xmospotligh only?

As you know I´m not a coder but I´ll try to help to get that function working nice


its a modified function.. and it works, but i didnt check if it will always work or if there would be a situation where it will break .
The version of XM-Spotlight im working on has it working, but the thing is that i modified the class file and i'll have to change some code in the module to include the new file i gotta include with the module . and i am also changing the database table a bit. (i had to temporarilty put the saved settings somewhere so i just put it in a new row in the table. so now i gotta find a better spot for it.)

im also working on making this module work with other languages and a couple of the admin things are hardcoded in english, so thats gotta be changed. Edit:. decided not to change the admin at this point. maybe later. other things are more important at the moment.

and i also changed the function a bit.

Posted on: 2006/10/20 20:50

Edited by Bandit-X on 2006/10/22 7:47:00
_________________
Bandit-X.Net
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Webmaster
Joined:
2006/6/3 9:27
From UsA - MiChIgAn
Posts: 154
Offline
Ok. Released A New Version Of XM-Spotlight.

XM-Spotlight 1.02Beta2 10272006 (OCT 27, 2006)

Posted on: 2006/10/28 5:37
_________________
Bandit-X.Net
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Webmaster
Joined:
2006/6/3 9:27
From UsA - MiChIgAn
Posts: 154
Offline
i see that Hervé got a new version of news for download. (News 1.50). i haven't tested it out yet though, but i hear good things about it.. next week is finals week so i will be pretty busy with the exams. lately i've been a bit busy with homework and studying.

update: so i was reading some comments at the xoop.org site.. XM-Spotlight at its current release will not work . since some of the functions in 'News' were changed.

Posted on: 2006/12/8 4:37
_________________
Bandit-X.Net
Transfer the post to other applications Transfer


Re: XM-Spotlight 1.02 In The Works.
Webmaster
Joined:
2006/6/3 9:27
From UsA - MiChIgAn
Posts: 154
Offline
been a while since i replied to this thread. its a long read and ill try to keep the 1st post updated.

the current version of xm-spotlight (Download Link Sept 2007) works with news 1.5x.

Sept 2007 Bugs are. Link Here.

i've been busy with school and other distractions. i really want to finish this module back in january, but time is my enemy.

Posted on: 2008/3/19 7:37
_________________
Bandit-X.Net
Transfer the post to other applications Transfer



« 1 (2) 3 »

 Topic is Locked


You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]