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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 103
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 77
  • Total: 77

PHP Aid

Started by Inny, April 22, 2009, 09:55:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Inny

Link to my site: http://www.epu-wow.com
SMF version: 1.1.8
TP version: 1.0.3
Theme name and version: Urban by Dzinerstudio
Mods installed:
1.     Pretty URLs Extras      0.9       [ Uninstall ]  [ List Files ]  [ Delete ]
2.    Move Old Topics    1.0    [ Uninstall ] [ List Files ] [ Delete ]
3.    Separate Sticky and Normal Topic    1.0    [ Uninstall ] [ List Files ] [ Delete ]
4.    Advanced Contact Form    1.1    [ Uninstall ] [ List Files ] [ Delete ]
5.    SMF Gallery Pro    1.4.5    [ Uninstall ] [ List Files ] [ Delete ]
6.    MCLegendII.2    3.0    [ Uninstall ] [ List Files ] [ Delete ]
7.    TinyPortal    1.075    [ Uninstall ] [ List Files ] [ Delete ]
8.    Regular smileys to dark background smiley set    1.0    [ Uninstall ] [ List Files ] [ Delete ]
9.    BBC Blizzard Quote Tag    1.0.3    [ Uninstall ] [ List Files ] [ Delete ]
10.    SMF 1.0.15 / 1.1.7 Update    1.0    [ List Files ] [ Delete ]
11.    SMF 1.0.14 / 1.1.6 Update    1.0    [ List Files ] [ Delete ]
12.    Aeva ~ Auto-Embed Video & Audio    5.2.56    [ List Files ] [ Delete ]
13.    Internal_Links_Use_Same_Window    1.2    [ Uninstall ] [ List Files ] [ Delete ]
14.    Googlebot & Spiders Mod    2.0.4    [ Uninstall ] [ List Files ] [ Delete ]
15.    [HTML] Permission Mod    1.01    [ Uninstall ] [ List Files ] [ Delete ]
16.    No Spam by Guests!    0.2    [ Uninstall ] [ List Files ] [ Delete ]
17.    Perfect Smiley Set    1.0    [ Uninstall ] [ List Files ] [ Delete ]
18.    TinyPortal    1.063    [ List Files ] [ Delete ]
19.    vBulletin Style Meta Tags    1.1    [ Uninstall ] [ List Files ] [ Delete ]
20.    Visual Verification Options    0.5.2    [ Uninstall ] [ List Files ] [ Delete ]
21.    RSS Feed Icon    1.1    [ Uninstall ] [ List Files ] [ Delete ]
22.    Aeva ~ Auto-Embed Video & Audio    6.2.75    [ Uninstall ] [ List Files ] [ Delete ]
23.    SMF 1.0.13 / 1.1.5 / 2.0 b3.1 Update    1.0    [ List Files ] [ Delete ]
24.    SMF 1.0.16 / 1.1.8 Update    1.0    [ Uninstall ] [ List Files ] [ Delete ]
25.    Regular smileys to dark background smiley set    1.0    [ Uninstall ] [ List Files ] [ Delete ]
26.    SMF Media Gallery    1.5.5    [ Uninstall ] [ List Files ] [ Delete ]
27.    User Control Panel By Alan S    2.0    [ Apply Mod ] [ List Files ] [ Delete ]
28.    Highslide Image Viewer    1.0    [ Uninstall ] [ List Files ] [ Delete ]
29.    Pretty URLs    0.9.1    [ Uninstall ] [ List Files ] [ Delete ]
30.    SMF Secure Login    1.0.4a    [ Uninstall ] [ List Files ] [ Delete ]
31.    Spoiler Tag    0.6    [ Uninstall ] [ List Files ] [ Delete ]
32.    reCAPTCHA for SMF    0.9.5.3    [ Uninstall ] [ List Files ] [ Delete ]
33.    AjaxChat Integration    3.0    [ Apply Mod ] [ List Files ] [ Delete ]
34.    Hide Info Center From Guests    1.0    [ Uninstall ] [ List Files ] [ Delete ]
Related Error messages: No error messages

Im requiring some aid to include something in a php article. Anyone that can help feel free to PM or reply here.

Thanks if advance.

P.S.: Some mods are just uploaded and no installed.

Lesmond

Not that I am any good with php, to help you we would need more info, like what do you want to add to a article?  or you could read the Posting Guidelines Please!

Inny

#2
I dont see how my Site info will help on this since its a simple php include in an article, thats why i posted this topic in Chit-Chat and not Support.

Edited my first post to fit your needs.

Missed a question: Im generating daily reports. Those daily reports are saved in a directory in the server root. In that directory i have an index.html which gives links to various html report files in that directory.

So far i was adding those reports in an iframe, but i would like to work on it some more and include them with php. Problem i have with that is that the links in the index.html are pointing after the article name.

This is the code i tried to use.


  /* If the script you are trying to include a file into is
       within a sub-folder of the web root, then include
       that folder in the path*/
    $dirName = dirname($_SERVER['PHP_SELF']);

    // If the including folder is sitting below the script, omit this part.

    /* Concatenate all the above values to set the includes
       folder in the path of php parser to find the scripts
       called with the include() function.*/
    ini_set('$dirName . 'raidreports/190409/');

    // After the above configuration, now you can call your scripts just by their name:
    include('index.html');




Ken.

Inny, I've moved your topic to the support boards so that one of our code specialists may see it and be able to offer help.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Zetan

Quote from: Inny on April 22, 2009, 09:55:37 AM

Anyone that can help feel free to PM or reply here.


We try not to encourage the use of PMs for support, please keep all support topics in the boards where other members can benefit.

Thanks.



Inny

Quote from: Zetan on April 22, 2009, 01:30:16 PM
Quote from: Inny on April 22, 2009, 09:55:37 AM

Anyone that can help feel free to PM or reply here.


We try not to encourage the use of PMs for support, please keep all support topics in the boards where other members can benefit.

Thanks.




Yeah i asked for PM support because its not TP specific (kinda), while i knew that someone else might need it, there are plenty of forums around that i can ask this but im more bonded with this one :P

In any case thanks.

JPDeni

I'm wondering about the use of include here. That function should be used with a php file. The function loads in the file and tries to execute it. There's nothing to execute in an html file.

What you can do is read the file into memory and then echo it out. For example, the file command reads the file and places it into an array. Then it would just be a matter of looping through with a foreach and echo-ing the line.

Also, I'm not familiar with the ini_set function, but in reading about it, I don't think that's what you want.

You might give this a try:


$dirName = dirname($_SERVER['PHP_SELF']);
$fileName = '$dirName . 'raidreports/190409/';
$lines = file($fileName);
foreach ($lines as $line)
  echo $line;


You might still run into trouble if this is a complete html file, though, because you're going to have an extra head section and other stuff that shouldn't be in an article. I'm not sure if it'll cause any problems or not. Only one way to find out. ;)

Inny

The above gives error on line 2.

The html file is complete yes. I guess any problem wont show up with iframe but it will with this method.

IchBin

$fileName = '$dirName . 'raidreports/190409/';

Should be:
$fileName = $dirName . 'raidreports/190409/';

Inny

becomes an empty article this way.

Only way i could make it work was with include, just somehow need to find a way to make the links right

This website is proudly hosted on Crocweb Cloud Website Hosting.