Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2005, 11:51 AM
lebanon lebanon is offline
 
Join Date: Jan 2005
Location: Lebanon
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 .
Reply With Quote
  #2  
Old 05-26-2005, 03:17 PM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 05-26-2005, 03:24 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 05-29-2005, 07:23 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 05-30-2005, 11:24 AM
lebanon lebanon is offline
 
Join Date: Jan 2005
Location: Lebanon
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 .
Reply With Quote
  #6  
Old 05-30-2005, 07:29 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

define "$name" in the outside variables of your webtemplate so that webtemplate will not clear it.
Reply With Quote
  #7  
Old 05-31-2005, 05:19 PM
lebanon lebanon is offline
 
Join Date: Jan 2005
Location: Lebanon
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 !
Reply With Quote
  #8  
Old 05-31-2005, 05:40 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Screenshot will help
Attached Images
File Type: jpg outside.jpg (66.2 KB, 0 views)
Reply With Quote
  #9  
Old 06-07-2005, 09:48 AM
lebanon lebanon is offline
 
Join Date: Jan 2005
Location: Lebanon
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 !
Reply With Quote
  #10  
Old 06-07-2005, 10:20 AM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

I would like to know how this turns out
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:17 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07082 seconds
  • Memory Usage 2,290KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete