Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2011, 01:37 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Fopen Alternative

My fopen is currently disabled.

Would there be an alternative to it?

here's the script snippet

Quote:
function saveFeed($filename="", $displayContents=true) {
if ($filename=="") {
$filename = $this->_generateFilename();
}
$feedFile = fopen($filename, "w+");
if ($feedFile) {
fputs($feedFile,$this->createFeed());
fclose($feedFile);
if ($displayContents) {
$this->_redirect($filename);
}
} else {
echo "<br /><b>Error creating feed file, please check write permissions.</b><br />";
}
}

}
Thank you
Reply With Quote
  #2  
Old 10-24-2011, 01:45 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...how is it disabled, do you get that "check write permissions" message or some other message?

I don't know of an alternative (although that doesn't mean there isn't one). There's file_put_contents(), but the docs say that's equivalent to using fopen().
Reply With Quote
  #3  
Old 10-24-2011, 01:51 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes I do

Quote:
Warning: fopen(/feed.xml) [function.fopen]: failed to open stream: Permission denied in /home/xxxxxxx/gallery/feedcreator.class.php on line 684

Error creating feed file, please check write permissions.
( I did chmod the file) which prompted me to look further and realizes it was the fopen.

and when I look in my php info

It's turned off locally and master. (the host had asked me and I had agreed) i did read there is an alternative (such as curl) but I can't seem to understand how to change it?

i've tries : file_put_contents() and it doesn't work either...
Reply With Quote
  #4  
Old 10-24-2011, 01:56 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I know you can disable certain protocols to be used with fopen(), like the ability to access file via http. But I don't know that there's any way to completely disable file access, and that error message kind of looks like a directory permission problem.

The error message says fopen(/feed.xml), if it's really trying to create a file at the server root then you probably *don't* have write permission.
Reply With Quote
  #5  
Old 10-24-2011, 02:02 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I ran out of idea....

It is trying to open /feed.xml which is in /gallery

I did chmod it it 777 666 to see neither works, gives me the same error.

I tried hard coding the link...http.... and such nothing's working and the original author
Reply With Quote
  #6  
Old 10-24-2011, 02:06 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If the file name is "/feed.xml" that won't be in the gallery subdirectory. Is there a config file or settings or something? Maybe it's missing the path to the gallery directory.
Reply With Quote
  #7  
Old 10-24-2011, 02:11 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No configs however it shows this

Quote:
echo $rss->saveFeed($type, $gallerypath ."/feed.xml");
and my gallery path is www.dancehallareaz.com/gallery

and what i'm trying to run is http://www.dancehallareaz.com/gallery/rss.php

some place in the scripts i see news/ I've tried that

Tried root ./

any other suggestion?
Reply With Quote
  #8  
Old 10-24-2011, 02:17 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That does look like the problem is with the gallery path. I don't know where that's supposed to be set, you may have to go back and look at the mod instructions and/or code to figure it out.

BTW, there are two kinds of "path" - the one that you use to access files via your web server, and the one that the OS uses. Usually the web server "root" (/) is a subdirectory of the OS file system. So if a php program wants to open a file on the server you probably need the OS path and not the one that starts with www.dancehallareaz.com (if your gallery directory is under the vb forum directory you might be able to use "./gallery" as the gallery path).
Reply With Quote
Благодарность от:
MissKalunji
  #9  
Old 10-24-2011, 02:28 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bingo!

He didn't mention there was an edit to do in rss.php

I search in each file and found there was an empty one :

Quote:
// Set Gallery PATH. ( no end slash "/" )
// $gallerypath = "/public_html/gallery";
$gallerypath =
Thank you! !!
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 07:00 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.05183 seconds
  • Memory Usage 2,246KB
  • Queries Executed 13 (?)
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
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (1)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete