TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 210
  • Total: 211
  • @rjen

Add Wikipedia To Your Site.

Started by Xarcell, April 26, 2006, 12:19:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Xarcell

I guess using stylesheet with dynamic iframe is the best way to go? This way, you have the colors and everything matching, while it stays within TP without scrollbar.


Crystallas

Are the logins bridged too?

I have a wiki and smf_tp on one site, but as a few have said, never thought of integrating them.

Xarcell

It's displays text & links only...
No login, no images.

bloc

I think you are over-complicating it. You can use the code in the a.php file..but you don't need to have the a.php file itself.

- start a php article and insert:
$search_string=$_REQUEST['title'];

$sss=array("http://www.serebella.com/cyclo_script/article.php?title=",$search_string);
$ssss=implode('',$sss);
if($search_string=="")$ssss="http://www.serebella.com/cyclo_script/topics.html";
$file = fopen ($ssss, "r");
if (!$file) {
    echo "<p>Unable to open remote file.\n";
    exit;
}

$html_code="";
while (!feof ($file))
   {
    $line = fgets ($file, 1024);
    $array = array($html_code, $line);
    $html_code = implode(' ', $array);
   }

fclose($file);

print $html_code;


This is the "work" page, which you send the request too. Get the page=xx number for it.

- create another page, php or html, and simply add something that will link as follows: index.php?page=xx;title=yoursubject.

Then the "work" page will show the result from wiki in full, no iframe and no ssi. You can add  something on top or bottom to get back to your "search page"..or add another link. The "search page" could be like the "topics.html" or even better: a simple form, which goes to index.php?page=xx. Call the input field "title". The page will then pick up the $_REQUEST['title'].

example: http://www.tinyportal.net/smf/index.php?page=31 - try searching for "Astronomy". ;)

Xarcell

Quote from: Bloc on April 30, 2006, 09:09:50 PM
I think you are over-complicating it.

Yep, that's me.

I'm trying to follow you, but I'd have to do it to understand it exactly. I will start on it soon.

However, I noticed something. In your example, after searching for "Astronomy", it comes up. However, when I click a link within that article, it comes up blank.

bloc

Yes, I see it. That might need some redirecting...hm, one moment.

bloc

A simple redirect is done..but its not optimal.

Xarcell

That seems good enough. Your slick...

What would we ever do without you?

:)

Xarcell

#38
Ok, I'm trying to get this working so I can understand it better and try to offer support for it.

I cannot seem to get it to work. This is the part where I get confused:

Quote- create another page, php or html, and simply add something that will link as follows: index.php?page=xx;title=yoursubject

To link to the "work" article? ex: index.php?page=4;title=Astronomy

When I do that, it comes up with a message saying: Unable to open remote file.

bloc

Here are my code for the 2 pages, plus the redirect code:

"search page" (page=31) PHP-type:
echo '<br><br><h3>
type your serch word here, and the result from wiki will appear in another article</h3>
<form name="wikisearch" action="index.php?page=30" method="post">
<input name="title" type="text" value=""><input type="submit" value="Search wiki"></form>';


"result page" (page=30) PHP type:
$search_string=$_REQUEST['title'];

$sss=array("http://www.serebella.com/cyclo_script/article.php?title=",$search_string);
$ssss=implode('',$sss);
if($search_string=="")$ssss="http://www.serebella.com/cyclo_script/topics.html";
$file = fopen ($ssss, "r");
if (!$file) {
    echo "<p>Unable to open remote file.n";
    exit;
}

$html_code="";
while (!feof ($file))
   {
    $line = fgets ($file, 1024);
    $array = array($html_code, $line);
    $html_code = implode(' ', $array);
   }

fclose($file);

echo '<div style="background: white; border: solid 3px #d0d0d0; padding: 30px;">'.$html_code.'</div>';



a.php, uploaded into the forum folder:
<?php

$title
=$_GET['title'];



echo 
'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Bloc Zone</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location=\'"+args[i+1]+"\'");
}
//-->
</script>
</head>

<body onLoad="MM_goToURL(\'parent\',\'http://www.tinyportal.net/smf/index.php?page=30;title='
.$title.'\');return document.MM_returnValue">

</body>
</html>'
;

?>


You start with "search" page, type what you need, and get sent to "result page". Any link in "result page" points to a.php, so a redirect file must send you back to "result apge" - with the new search string, just as Wiki works.

In this result page, another link to the first "search page" could be added, like "search for another" etc.

This website is proudly hosted on Crocweb Cloud Website Hosting.