× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
5
a
5
k
5
c
5
B
5
l
5
C
4
s
4
a
4
t
4
i
4
r
4
New Topic  
BearPro BearPro
wrote...
Valued Member
Posts: 382
12 years ago
HI, hope you remember me Waving Hand Sign

I decided not to use mediawiki for the dictionary. Instead i got a code block of custom php in simple portal to search within a particular board that i have name as dictionary. Users can search only from that particular board. and i modified my search.template.php to display html messages in case user dosent finds the word he is looking for so that he can be redirected to add new word page. that I have got post moderation protected. So that , any thing posted in there is moderated before it gets published.
I didnt wanted mediawiki because if smf updates get in conflict with mediawiki then i have to do the procedure all over again or maybe i have to stick to that version only.


so dictioanry problem is solved.

How is that you display unanswered questions?
I hae been struggling with this lately Confounded Face

if a topic is solved,
Read 7505 times
22 Replies
I don't feel like riding until everything blurs.

Ask Me Maths Questions

Related Topics

Replies
wrote...
Educator
12 years ago
Instead i got a code block of custom php in simple portal to search within a particular board that i have name as dictionary. Users can search only from that particular board.

That's not a good idea, look at this mod. This is exactly what you need.

http://custom.simplemachines.org/mods/index.php?mod=1525
wrote...
Educator
12 years ago
Here's another excellent wiki mod that could work for you. You don't even need to create a wiki, it creates it for you!

http://www.simplemachines.org/community/index.php?topic=272676.0
wrote...
Staff Member
12 years ago
I'm moving this topic to the appropriate board.
- Master of Science in Biology
- Bachelor of Science
BearPro Author
wrote...
Valued Member
12 years ago Edited: 12 years ago, foadbear
Here's another excellent wiki mod that could work for you. You don't even need to create a wiki, it creates it for you!

http://www.simplemachines.org/community/index.php?topic=272676.0
Instead i got a code block of custom php in simple portal to search within a particular board that i have name as dictionary. Users can search only from that particular board.

That's not a good idea, look at this mod. This is exactly what you need.

http://custom.simplemachines.org/mods/index.php?mod=1525

thanks bio_man
can i use them on my SMF. wont they conflict with the new smf updates?

what you think.
do let me know
.
If they wont , then these mods are exactly what i need.
you rock
 Slight Smile
I don't feel like riding until everything blurs.

Ask Me Maths Questions

wrote...
Educator
12 years ago
Here's another excellent wiki mod that could work for you. You don't even need to create a wiki, it creates it for you!

http://www.simplemachines.org/community/index.php?topic=272676.0
Instead i got a code block of custom php in simple portal to search within a particular board that i have name as dictionary. Users can search only from that particular board.

That's not a good idea, look at this mod. This is exactly what you need.

http://custom.simplemachines.org/mods/index.php?mod=1525

thanks bio_man
can i use them on my SMF. wont they conflict with the new smf updates?

what you think.
do let me know
.
If they wont , then these mods are exactly what i need.
you rock
 Slight Smile

Try the installation, if there are errors, let me know. Do not go ahead with the installation. If you decide to do the glossary, do not do the wiki mod, and vice versa.
BearPro Author
wrote...
Valued Member
12 years ago
did the installation of wiki mod by using emulate feature.
still then there was one test failed in installation process.
details are...


in manage settings.php
code find
   );

   // Are we getting info for the help section.


code(add before)

// wiki = wiki
      'wiki' => array(
         'url' => 'action=admin;area=wiki',
         'settings' => array(
            'wikiEnabled' => 1,
         ),
      ),

 i did this manually
after doing this i still get an error in error logs
http://dl.dropbox.com/u/35279697/error.JPG(see the image )


wiki parser.php is also http://dl.dropbox.com/u/35279697/WikiParser.phpattached


http://dl.dropbox.com/u/35279697/ManageSettings.phphere is the managesettings.php

I don't feel like riding until everything blurs.

Ask Me Maths Questions

wrote...
Educator
12 years ago
So now what's the problem? Is the modification working? If so, no worries.

By the way, your attachments don't work.

dropbox.com...
BearPro Author
wrote...
Valued Member
12 years ago
i am attaching the attachemtns once more

have a look
this is the error i get



this is managesetting.php

http://dl.dropbox.com/u/35279697/ManageSettings.php

this is wiki parser

http://dl.dropbox.com/u/35279697/WikiParser.php


have a look
I don't feel like riding until everything blurs.

Ask Me Maths Questions

wrote...
Educator
12 years ago
That error doesn't mean there was an error in the installation. It means that is an error with the actual script of the modification (that's why it is a beta-modification), not official. Try uninstalling the modification to see whether the error goes away or not.
BearPro Author
wrote...
Valued Member
12 years ago
no, It didn't

OK. the exact functionality that i wanted was to let users search for a word and then if the word is not there, they should be able to add the same.
To do this, mediawiki is the best thing that can happen to my forum

If smf team release their official bridge, it would be nice and best for me

would you tell me how was displaying unanswered questions was done here in your forum.

P.S. please delete the above post.

I wrote it without realising that I am not logged in.
I don't feel like riding until everything blurs.

Ask Me Maths Questions

wrote...
Educator
12 years ago
no, It didn't

OK. the exact functionality that i wanted was to let users search for a word and then if the word is not there, they should be able to add the same.
To do this, mediawiki is the best thing that can happen to my forum

If smf team release their official bridge, it would be nice and best for me

would you tell me how was displaying unanswered questions was done here in your forum.

P.S. please delete the above post.

I wrote it without realising that I am not logged in.

Sorry for taking so long to reply. I tried installing the wiki modification on a separate, fresh SMF 2.0 installation and there were no problems. I think the modification is conflicting with another mod on your website. That doesn't mean, however, that they cannot coexist.

In wikimedia, when searching for a word, there are two options, "GO" and "SEARCH". When you press go, and the word you're searching for isn't there, it will ask if you want the word to be created. If you press "SEARCH", it will search the database to see if any other word has that word you're searching for in the body of that page. Do you mean you want that "Add a Dictionary Word" feature I have on the side?
BearPro Author
wrote...
Valued Member
12 years ago
Here Is exactly what I have implemented on my smf2.0

this is the block of simple portal on which i have written custom php code to search through a board named ditionary




when  searching through the dictionary block the user gets to this results page





Now through this custom html message that i can modify as per my need(appearing on search box) , I can redirect user to add a new word in the dictionary board which has post moderation on, and with some message at the top about posting guidelines.



I hope to use this as dictionary building and word searching on my forum.
what i wanted to know that ow was unanswered questions feature was achieved on your forum.
Are you using topic solved mod? If yes,then how have you managed to display unanswered questions.

I don't feel like riding until everything blurs.

Ask Me Maths Questions

wrote...
Educator
12 years ago
It is an SSI function I created that, unfortunately only works on 1.x Thinking Face

Code:
function ssi_unansweredTopics($num_recent = 8, $exclude_boards = null, $output_method = 'echo')
{
   global $context, $settings, $scripturl, $txt, $db_prefix, $ID_MEMBER;
   global $user_info, $modSettings, $func;

   if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
      $exclude_boards = array($modSettings['recycle_board']);
   else
      $exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

   $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
   $icon_sources = array();
   foreach ($stable_icons as $icon)
      $icon_sources[$icon] = 'images_url';

   // Find all the posts in distinct topics.  Newer ones will have higher IDs.
   $request = db_query("
      SELECT
         m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
         IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
         IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
         IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
      FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
         LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
         LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
      WHERE t.ID_LAST_MSG = m.ID_MSG
         AND t.numReplies = 0
         AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
         AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
         AND $user_info[query_see_board]
         AND ms.ID_MSG = t.ID_FIRST_MSG
      ORDER BY t.ID_LAST_MSG DESC
      LIMIT $num_recent", __FILE__, __LINE__);
   $posts = array();
   while ($row = mysql_fetch_assoc($request))
   {
      $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']), array('<br />' => '&#10;')));
      if ($func['strlen']($row['body']) > 128)
         $row['body'] = $func['substr']($row['body'], 0, 128) . '...';

      // Censor the subject.
      censorText($row['subject']);
      censorText($row['body']);

      if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
         $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

      // Build the array.
      $posts[] = array(
         'board' => array(
            'id' => $row['ID_BOARD'],
            'name' => $row['bName'],
            'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',
            'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'
         ),
         'topic' => $row['ID_TOPIC'],
         'poster' => array(
            'id' => $row['ID_MEMBER'],
            'name' => $row['posterName'],
            'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
            'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
         ),
         'subject' => $row['subject'],
         'short_subject' => shorten_subject($row['subject'], 25),
         'preview' => $row['body'],
         'time' => timeformat($row['posterTime']),
         'timestamp' => forum_time(true, $row['posterTime']),
         'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#new',
         'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#new">' . $row['subject'] . '</a>',
         'new' => !empty($row['isRead']),
         'new_from' => $row['new_from'],
         'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
      );
   }
   mysql_free_result($request);

   // Just return it.
   if ($output_method != 'echo' || empty($posts))
      return $posts;

   echo '
      <table border="0" class="ssi_table">';
   foreach ($posts as $post)
      echo '
         <tr>
            <td align="right" valign="top" nowrap="nowrap">
               [', $post['board']['link'], ']
            </td>
            <td valign="top">
               <a href="', $post['href'], '">', $post['subject'], '</a>
               ', $txt[525], ' ', $post['poster']['link'], '
               ', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
            </td>
            <td align="right" nowrap="nowrap">
               ', $post['time'], '
            </td>
         </tr>';
   echo '
      </table>';
}


// Show From all from a member group. Great for Rosters.
function ssi_membergroup($groupid = 1, $additional = 0, $sort = 1, $sortorder = 1, $output_method = 'echo')
{
global $db_prefix, $user_info, $scripturl, $modSettings, $txt, $sc;
//-- $mgroup = Group Number
//-- $Additional = Search Additional Groups as well
//-- $sort = How to sort the names. ID Number(2) or realname(1 default).
//-- $sortorder = Sort ASC or DESC

//Lets get some checks done for the sake of the script not returning errors
//if the groupids are array we need to make them valid.
if(is_array($groupid))
$groupid = array_map('intval',$groupid);

//Well the groupid is a single id.. lets make it valid..
if(!is_array($groupid))
$groupid = (int) $groupid;

//Either its off or its on.. Should also stop use of array..
if(($additional !=0 && $additional !=1) || ($sort !=2 && $sort !=1) || ($sortorder !=2 && $sortorder !=1))
fatal_error('Invalid Input for this ssi_function');

//We shouldn't be getting Group 0. Fix it by Showing Admin Group..
if($groupid == 0)
$groupid = 1;

//Set our output to something its better than nothing.
$membergroup = array();

//Find out if our groups we are looking at is in an array or not..
if(is_array($groupid))
{
//Array has multiple groups so if we want to search additional as well we have to loop it.
if(isset($additional) && $additional != 0)
{
//lets just clear additional instead of a new variable.
$additional = '';
foreach($groupid as $add)
$additional .= '
OR FIND_IN_SET('.$add.', additionalGroups)';
}
$request = db_query("
SELECT ID_MEMBER, realname, ID_GROUP
FROM {$db_prefix}members
WHERE ID_GROUP IN (" . implode(', ',$groupid) . ")".$additional."
ORDER BY '".($sort == 2 ? 'ID_MEMBER' : 'realname')."' ".($sortorder == 2 ? 'DESC' : 'ASC')."", __FILE__, __LINE__);
}
else
$request = db_query("
SELECT ID_MEMBER, realname, ID_GROUP
FROM {$db_prefix}members
WHERE ID_GROUP = " . $groupid . ($additional == 1 ? "
OR FIND_IN_SET(" . $groupid . ", additionalGroups)" : "")."
ORDER BY '".($sort == 2 ? 'ID_MEMBER' : 'realname')."' ".($sortorder == 2 ? 'DESC' : 'ASC')."", __FILE__, __LINE__);

//We got the query. Now lets get it into a nice little array..
while ($row = mysql_fetch_assoc($request))
$membergroup[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realname']
);
mysql_free_result($request);

//If they dont want to echo.. So lets give it to them..
if ($output_method != 'echo')
return $membergroup;

//Well they want it echo so lets echo...
foreach ($membergroup as $mem)
echo '
<a href="'.$scripturl.'?action=profile;u='.$mem['id'].'" class="ssi_membergroup" id="ssi_member_'.$mem['id'].'">'.$mem['name'].'</a><br/>';
}

Once you put this into your SSI file, you can call out:

ssi_unansweredTopics(10);
  New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1233 People Browsing
Related Images
  
 372
  
 195
  
 816
Your Opinion
What's your favorite funny biology word?
Votes: 328