![]() |
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:
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 . |
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. |
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.
|
Quote:
* 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:
|
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> <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 . |
define "$name" in the outside variables of your webtemplate so that webtemplate will not clear it.
|
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 ! |
1 Attachment(s)
Screenshot will help
|
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 !
|
I was actually thinking about something like this just the other day.
I would like to know how this turns out :) |
Hi again , and thanks to Logician and his great suggestion of the ob_start ,
ob_start(); include("mycode.php"); $my_code = ob_get_contents(); ob_end_clean(); Except that it didnt work exactly as the $name variable wouldnt pass so i finally did the include line replaced with the line below : include "http://www.tchatting.com/forum/imdb.php?mid=".$mid."&xm=".$xm; now the pages do load , and the form to post works as well , i still have a minor issue am going to solve by today which is trimming white spaces. As for example : when searching for "the end" will make the url go like : "the+end" and that will break the eval code which logician templates use . From the form i will trim the white spaces as i noticed that searching for "theend" does return the same results , although i do find this a bit annoying as am afraid some movies will not return a search result if it didnt find it in IMDB without the spaces. IF there is a way to leave the + without affecting the eval parse error in Logician templates it will be nice , if not i will use the removal of white spaces from the initial form poster. I will update u with results anyway. Hi again ! Finally its working ... I wasted a bit of time trying to trim the user search movie input before its sent to the url then i was like i said wasting my time , i just did it through Logician templates ( thanks again to logician where his hack made this possible ) I used str_replace to the string above to eliminate the white spaces in the line , then i have now a working demo http://www.tchatting.com/forum/view.php?pg=movies Thanks again for the help logician , your tips made it possible ! I'll attach the files related to this later on here depending on which section is suitable or if anyone is interested anyway ! |
That looks excellent!
Nice work :) I wouldnt mind knowing how you got it to work. I got a lot of positive feedback when I added just a IMDB VBA portal, so Im sure people would love this. |
Ok where should i post this in which section ?
As i dont have the right to call it my hack , i wouldnt have done it except for logician templates , so maybe a logician templates " imdb templates addon?" |
|
KevinL thanks for the advice , i just sent him a prvt msg and waiting his reply
Am writing a readme file on how to install this , except that i added manual entries in the files users will have to change manually and not only a config file. |
All times are GMT. The time now is 11:34 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|