vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   imdb integration (https://vborg.vbsupport.ru/showthread.php?t=82061)

lebanon 05-26-2005 11:51 AM

imdb integration
 
Hello,
I have this imdb source that is working fine as in searching and fecthing information from imdb , anyway none of the files that the whole code is based on , i wasnt able to add on any of them the header and/oor footer of vb .
Am confused, whenever i try ti include the global.php and the header template they are parsed but my code is not, or vise versa !
here is a sample of one of the pages am trying to include a header and footer for ;
PHP Code:

<?

require_once("imdb_config.php");
require_once("imdb.class.php");

$conf = new imdb_config;
echo "<HTML><HEAD><TITLE>cache</TITLE></HEAD><BODY>";
$movie = new imdb ("0");
if ($d = opendir ($conf->cachedir)) {
     while (false !== ($entry = readdir ($d))) {

      if (strstr ($entry, "Title")) {

           $imdbid = substr ($entry, 0, 7);
//                      echo $imdbid."<BR>";
           $movie->setid ($imdbid);
           echo "<a href=imdb.php?mid=";
           echo $imdbid;
           echo ">";
           echo $movie->title ();
           echo "</a>";
           echo " <a href=\"http://us.imdb.com/title/tt";
           echo $imdbid;
           echo "\">imdb page</a>";
           echo "<br>\n";

      }

     }
}
echo "</BODY></HTML>";
?>

any ideas ?
id like those file to have same theme as my forum !

Oh, i tried it using logician web templates hack , if i parse them using the template body as php , they show up alone , and if i parse them using his INCLUDE field ( he already stated the result there anyway) its parsed above the header .

Reeve of shinra 05-26-2005 03:17 PM

Take a look at the vb tutorial section for how to create a vb powered webpage.

That will give you the tie in to use the vb header and footer to call a template.

You can add most of your script in to the body part of that tutorial but I think you'll need to strip out the echos and call that via the variable in the template.

Hope this helps. I am curious to see how this turns out.

ericgtr 05-26-2005 03:24 PM

I dug this up at sourceforge and installed it, it's pretty cool stuff. I don't have a real need to integtrate it into my board but like Reeve mentions, all the echos would have to be removed and the variables outputted to templates. Not a major task but still a pain, it wouldn't be too hard to integrate with a little time though.

Logician 05-29-2005 07:23 AM

Quote:

Originally Posted by lebanon
Hello,
I have this imdb source that is working fine as in searching and fecthing information from imdb , anyway none of the files that the whole code is based on , i wasnt able to add on any of them the header and/oor footer of vb .
Am confused, whenever i try ti include the global.php and the header template they are parsed but my code is not, or vise versa !
here is a sample of one of the pages am trying to include a header and footer for ;
PHP Code:

<?

require_once("imdb_config.php");
require_once("imdb.class.php");

$conf = new imdb_config;
echo "<HTML><HEAD><TITLE>cache</TITLE></HEAD><BODY>";
$movie = new imdb ("0");
if ($d = opendir ($conf->cachedir)) {
     while (false !== ($entry = readdir ($d))) {

      if (strstr ($entry, "Title")) {

           $imdbid = substr ($entry, 0, 7);
//                      echo $imdbid."<BR>";
           $movie->setid ($imdbid);
           echo "<a href=imdb.php?mid=";
           echo $imdbid;
           echo ">";
           echo $movie->title ();
           echo "</a>";
           echo " <a href=\"http://us.imdb.com/title/tt";
           echo $imdbid;
           echo "\">imdb page</a>";
           echo "<br>\n";

      }

     }
}
echo "</BODY></HTML>";
?>

any ideas ?
id like those file to have same theme as my forum !

Oh, i tried it using logician web templates hack , if i parse them using the template body as php , they show up alone , and if i parse them using his INCLUDE field ( he already stated the result there anyway) its parsed above the header .

Regarding webtemplates:

* Set parsing as HTML or TEXT (not PHP).
* Put your code into seperate .php file where view.php resides (eg. mycode.php)
* Use this code in your webtemplate's phpinclude field:
PHP Code:

ob_start();
include(
"mycode.php");
$my_code ob_get_contents();
ob_end_clean(); 

* Then you can use $my_code variable to paste the content of your php file in anywhere you like in your webtemplate.

lebanon 05-30-2005 11:24 AM

Hi guys,
thanks for your advices ,
regarding the first two replies , i tried to do that and since am not good at php i wasnt able to , and when i tried playing around , it returned variables messed up
Or it returned blank files !
Another thing , the cache file is one listed above , for example the imdbsearch file gets posted data ( method post in search box ) and the imdbsearch uses _GET ,
Adding global.php somehow stops the rest from being parsed and i dont know why !
As for logician suggestion i will try now , but logically speaking cache.php code (above code) will work but as for imdbsearch .php am confused if it will work because
example : imdbsearch.php?name=Rock ( is a sample of a posted request )
Logician templates will require | /forum/view.php?pg=test
So if i parse the search within it , how should i post the data to url ?
Is it possible logician ?
If its not , is there a way to just include the header to other sections of my website located outside of it !
The problem is i have many free sections outside my forum and movies search is one of them , i wish to include headers so users ( might be tempted to register ) and widen my users database !

Just an update ,
Logician advice made the cache.php work fine ,
But as i expected that wouldnt just work for the search.php !
imdbSearch gets variables from a post like :
<FORM ACTION="imdbsearch.php" METHOD=get>
&nbsp;<p>
<INPUT TYPE="text" NAME="name" SIZE=30 MAXLENGTH=50><BR>
<INPUT TYPE="submit" VALUE="Submit">

Even if i included the imdbsearch in ob_start as above example
and changed the form to post name=pg and value=movies (for example )
And the link will show as view.php?pg=movies&name=rock (for example )
but the variable is not passed to the included moviesearch and will not be excuted .

Again my whole porpuse is to include the HEADER to a PHP file and making a VB page example using templates works when ur adding HTML page , anything including codes or php GET or POST will not be passed , unlike what i want .

Logician 05-30-2005 07:29 PM

define "$name" in the outside variables of your webtemplate so that webtemplate will not clear it.

lebanon 05-31-2005 05:19 PM

hello
how do u mean add it as an outside variable ?
name is what it gets from http get variable ...
oh why am speaking it , here is the code line

<?

require ("imdbsearch.class.php");

$search = new imdbsearch ();
$search->setsearchname ($HTTP_GET_VARS["name"]);
echo "<HTML><HEAD><TITLE>search</TITLE></HEAD><BODY>";
$results = $search->results ();
foreach ($results as $res) {

echo "<a href=imdb.php?mid=";
echo $res->imdbid();
echo ">";
echo $res->title();
echo "(".$res->year().")";
echo "</a> ";
echo " <a href=\"http://us.imdb.com/title/tt";
echo $res->imdbid();
echo "\">imdb page</a>";
echo "<br>\n";
}

echo "</BODY></HTML>";
//echo $search->page;

?>

if you want check the normal excuted code at
http://www.tchatting.com/forum/imdbsearch.php?name=rock

when we create a web template the code new link will look like
http://www.tchatting.com/forum/view....arch&name=rock

The idea would be great if the results are passed within the template itself !

Logician 05-31-2005 05:40 PM

1 Attachment(s)
Screenshot will help

lebanon 06-07-2005 09:48 AM

sorry i havent replied this for a while, i had too much work , ill try your method again and let you know of my results , thanks again !

KevinL 06-07-2005 10:20 AM

I was actually thinking about something like this just the other day.

I would like to know how this turns out :)


All times are GMT. The time now is 12:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02124 seconds
  • Memory Usage 1,760KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete