Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Svenskunganka;45202145]Has anyone tried [URL="https://nodebb.org/"]NodeBB[/URL] out yet? Any inputs?[/QUOTE]
I tried it a while ago. It's neat, but it's not as feature-filled as most mature forum packages today. Plus the auto-updating feature has a few bugs. That might be different now, though.
I feel really stupid asking this...But...
[code]
<?php
$webApi = '<steam web API ID>';
function getbase($id)
{
$baseFile = file_get_contents('data/players/'.htmlspecialchars($id)."/info.txt");
if($baseFile == "")
{
$url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".htmlspecialchars($webApi)."&steamids=".htmlspecialchars($id);
$contents = file_get_contents($url);
var_dump(json_decode($contents));
}
};
?>
[/code]
This always return this:
[code]
Notice: Undefined variable: webApi in C:\xampp\htdocs\osdb\datapacking.php on line 11
[/code]
Maybe i haven't readed enough, but i can't see how to define a variable (I thought that just was a simple $foo = "hi"
What's line 11?
If I had to guess I would say that it's inside the function you posted, but since it's inside the function it's looking for $webApi in the scope of that method and not the file.
Just add
[code]global $webApi;[/code]
to the top of your function. More info: [url]http://www.php.net//manual/en/language.variables.scope.php[/url]
[QUOTE=supersnail11;45216826]Just add
[code]global $webApi;[/code]
to the top of your function. More info: [url]http://www.php.net//manual/en/language.variables.scope.php[/url][/QUOTE]
This will work but globals are bad and not a good habit to get into as they make debugging difficult and obscure the flow of information through the code.
Better would be to pass $webApi through getbase() as an argument. Even better than that would be to make your code object orientated.
You could also use a constant for this:
[CODE]define('STEAM_API_ID', '<steam web API ID>');[/CODE]
and then
[CODE]$url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".htmlspecialchars(STEAM_API_ID)."&steamids=".htmlspecialchars($id);[/CODE]
[url]http://php.net/manual/en/language.constants.php[/url]
A few days ago, I got a job as a Web Developer for a company here in Sweden and I'm starting the 25th August this year, after the summer. Now this is great for me, as I can finally work full-time with something I love to do aswell as I'm getting paid to do so.
I've been hired primarily as their PHP developer and web designer. We've recently spoken about an upcoming task for me that will go live as soon as I start work there. The task is well paid for my company and has to be of maximum quality.
This troubles me a bit as I will take full responsibility of its quality and that I will be making it mostly by myself. I haven't worked with them at all yet, and I don't know anyone so I'm sure it's going to be a rough task to do.
The task is a design for a Wordpress installation and I have approximately 1 week to complete the task. I will get a .psd design from our customer about exactly how they want it to look like. The company I work for wants me to use myself of Bootstrap when making the design, which is good for me, as I have experience with Bootstrap. I won't have to do much PHP development for it though.
The company told me that they can put the task onto someone else or decline the job completely, and I am really unsure what I should do. Taking on such a big task the first day at my first web development job seems really risky for me, as the quality really have to be of the first class while it has to be completed in a week. However, if I manage to complete this task it will give me a great rep increase at the company, so I am really unsure what to do.
So I'm currently trying to solve the last problem before officially releasing my facepunch link shortener and that is making a firefox extension.
The problem is that I'm a chrome user and every time I try to access facepunch from firefox I just get the "Checking your browser" ddos protection thing indefinitely. (I tried logging out from facepunch and stuff)
Does anyone know a way around that? (A fresh IP might help, but I can't always restart my router to get a new one)
Wait, Firefox itself gets that every time or the extension?
If it's Firefox then is it set up to store cookies? Cloudflare will store a cookie after you see that page.
[QUOTE=LennyPenny;45231605]So I'm currently trying to solve the last problem before officially releasing my facepunch link shortener and that is making a firefox extension.
The problem is that I'm a chrome user and every time I try to access facepunch from firefox I just get the "Checking your browser" ddos protection thing indefinitely. (I tried logging out from facepunch and stuff)
Does anyone know a way around that? (A fresh IP might help, but I can't always restart my router to get a new one)[/QUOTE]
Do you have any privacy extensions for firefox? They might prevent CloudFlare from storing the cookie.
[URL="https://github.com/cpancake/fp-archive-tool/blob/master/index.js#L235"]It's possible to get around CloudFlare[/URL], but it shouldn't be necessary.
What would be the best approach to create another node process running a specific app with parameters?
What I need to do:
- start new node process
- retrieve it's PID
- store PID in MySQL.
I'm sure the last is a piece of cake, but I'm not sure how I'd start a new process that is not a child of the current process and then retrieve it's PID easily.
To reduce the amount of docs I have to write for nyx (a web framework/platform I'm working on) I'm considering basing some of them (outright copying) some stuff from [URL=http://guides.rubyonrails.org/]Rails Guides[/URL] since most of the explanation stuff is pretty generic. I would of course be following the license that they're released under by providing "NOTE: This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License and may be based upon the excellent Rails Guides." at the bottom of all relevant pages.
I'm kinda irky on it since even though I'm fine legally it still feels like I'm ripping them off. What are your thoughts?
[QUOTE=supersnail11;45232786]Do you have any privacy extensions for firefox? They might prevent CloudFlare from storing the cookie.
[URL="https://github.com/cpancake/fp-archive-tool/blob/master/index.js#L235"]It's possible to get around CloudFlare[/URL], but it shouldn't be necessary.[/QUOTE]
It's a fresh install, but using that private mode seems to have fixed it.
[editline]28th June 2014[/editline]
Does anyone have a basic tutorial on creating a firefox extension that's not much more than a userscript? (modifying the dom and copying something to your clipboard)
All guides I could find were either >2 years old or way too advanced.
[QUOTE=LennyPenny;45236264]It's a fresh install, but using that private mode seems to have fixed it.
[editline]28th June 2014[/editline]
Does anyone have a basic tutorial on creating a firefox extension that's not much more than a userscript? (modifying the dom and copying something to your clipboard)
All guides I could find were either >2 years old or way too advanced.[/QUOTE]
You can do both with a userscript. [url]http://stackoverflow.com/a/13077353/831514[/url] [URL]http://wiki.greasespot.net/GM_setClipboard[/URL]
Yes I already have a userscript, the only thing that's missing is a native firefox extension.
I sent the following to garry:
[code]
Currently your Regex for detecting youtube videos looks like this.
/\[MEDIA\]http:\/\/www\.youtube\.com\/watch\?v=(.+?)\[\/MEDIA\]/
if you just add s? to this regex, it will match both http:// and https://
/\[MEDIA\]https?:\/\/www\.youtube\.com\/watch\?v=(.+?)\[\/MEDIA\]/
The location to change these is in line 39 and 40 of fp_read_replies.user.js
Thanks for reading.[/code]
But all he did was replace script parsing with serverside parsing(using the same regex).
What should I do now to get his attention that it's still broken?
"remove the s" is a common enough topic that it comes up in every thread now.
What's the best way to show tab characters? The only way I could get it to show is by using <pre> but that just makes the whole thing look all spaced out.
[editline]29th June 2014[/editline]
[QUOTE=01271;45237493]I sent the following to garry:
[code]
Currently your Regex for detecting youtube videos looks like this.
/\[MEDIA\]http:\/\/www\.youtube\.com\/watch\?v=(.+?)\[\/MEDIA\]/
if you just add s? to this regex, it will match both http:// and https://
/\[MEDIA\]https?:\/\/www\.youtube\.com\/watch\?v=(.+?)\[\/MEDIA\]/
The location to change these is in line 39 and 40 of fp_read_replies.user.js
Thanks for reading.[/code]
But all he did was replace script parsing with serverside parsing(using the same regex).
What should I do now to get his attention that it's still broken?
"remove the s" is a common enough topic that it comes up in every thread now.[/QUOTE] Wait what, why are you PMing garry about a script I made? :L
Anyone know how to get Firefox UI tooltips to change colour? They work fine on webpage tooltips but I can't find a way to get the UI tooltips to change colour.
Browser:
[t]http://puu.sh/9Pn6A.png[/t]
UI:
[t]http://puu.sh/9Pnaq.png[/t]
The tooltips work perfectly fine for every other program, just Firefox is having a problem with it.
I should have mentioned i'm trying to do it with userChrome.css, I've got other tooltips working.
[QUOTE=isnipeu;45243403]Wait what, why are you PMing garry about a script I made? :L[/QUOTE]
I didn't make it into a script.
I independently found the problem and fixed it on my own.
I've had luck sending things through the cloudflare DDOS message box in the past so I'll wait until we're hit then.
[QUOTE=01271;45253913]I didn't make it into a script.
I independently found the problem and fixed it on my own.
I've had luck sending things through the cloudflare DDOS message box in the past so I'll wait until we're hit then.[/QUOTE]
.user.js means it's a userscript. [URL="http://facepunch.com/showthread.php?t=1394028"]You PM'd Garry about isnipeu's userscript[/URL].
I want to say this is web development related but it doesn't have a section it perfectly fits in, sorry if I post it in the wrong section :3 Anyway...
Me and my friend recently purchased a dedicated server for use with game server hosting for our community but also to mess around with web hosting a bit. I have installed mysql on the server but no matter what I try I can not enable remote connections, I have bind-ip set to *, the user set to allow connections from all ip's (%) and I have checked 29 times that the ports are opened on the firewall and that tcp is enabled in the config.
One more thing I would like to add is that we are using windows server 2012 r2 and also the odbc driver doesn't install but from what I can tell that driver is just for connecting windows's built in database management (I think)
Sorry if I sound dumb, I am relatively new to this sort of thing so its a learning experience for me
[editline]1st July 2014[/editline]
Oh just want to add, I get an error 110 when trying to connect
[QUOTE=ZombieWizzard;45258211]I want to say this is web development related but it doesn't have a section it perfectly fits in, sorry if I post it in the wrong section :3 Anyway...
Me and my friend recently purchased a dedicated server for use with game server hosting for our community but also to mess around with web hosting a bit. I have installed mysql on the server but no matter what I try I can not enable remote connections, I have bind-ip set to *, the user set to allow connections from all ip's (%) and I have checked 29 times that the ports are opened on the firewall and that tcp is enabled in the config.
One more thing I would like to add is that we are using windows server 2012 r2 and also the odbc driver doesn't install but from what I can tell that driver is just for connecting windows's built in database management (I think)
Sorry if I sound dumb, I am relatively new to this sort of thing so its a learning experience for me
[editline]1st July 2014[/editline]
Oh just want to add, I get an error 110 when trying to connect[/QUOTE]
[url]http://stackoverflow.com/questions/15576521/cant-connect-to-mysql-server-on-ipaddress-110[/url]
[url]http://stackoverflow.com/questions/24508420/facebook-api-delaying-rest-of-page[/url] If anyone could help with this then I will love them
using Telerik RadlistView in c#, can't get my insertitemtemplate to show for some reason
[url]http://stackoverflow.com/questions/24515317/telerik-radlistview-not-displaying-insertitemtemplate[/url]
Rant with a bit of self-added drama incoming, feel free to skip it. The above user's problem is probably more important than mine anyways.
Around a year or so I started with my first serious project in PHP, a file sharing web dedicated to skins of a game. Well, as serious as you can expect from some programming n00b that made his own HTML tags instead of divs. Seriously, some of that code was scary.
Anyways. It was quite a learning experience, and while it's far from bug-less, I'd say it can stand on its own. (Right now, it's at the point that I get debug emails, and I get a rush of happiness when it doesn't point out anything wrong.)
Time travel to a few days ago, when a more important person at that game makes another filesharing web dedicated the same thing. Differences? It's open-source, uses Laravel, an official URL, and he can just pin it on the official forums, so he gets more uploads and more feedback on three days than me on a year. (Admittedly, I gave mine publicity in way less populated forums. It still got to result number 1 in Google, though.)
Now, before I started anything, the game's author told me that an official one could be made at any moment (and this one sounds like that), so I knew this ocasion would happen, sooner or later. I didn't see it like this before, though.
So, the question that doesn't deserve its own thread is, should I keep going with mine, even though it might get overshadowed, with all the work spent on it being missed? Or should I just join the other guy and say fuck all to mine, leaving it on life support until the VPS expires?
It might look like I'm blowing it out of proportion; I probably am. It's just that I've gotten attached to it, being my first contribution and all that cheesy stuff.
If you can offer a better service, sure.
What's a good reliable to too expensive website host?
Looking to host my portfolio on a wordpress platform or should I just go for go daddy
I use [url=http://www.lithiumhosting.com/]Lithium Hosting[/url] for my portfolio
I'm not sure if this is the proper section to post this, but I'll ask anyways. I'm trying to install some apps for Google Chrome and every time, a window pops up and says "An Error Has Occured" and below it reads "NETWORK_FAILED."
It did this last night so I thought Google was just having some bad server issues. Still doing it this morning though. Is this still a problem on Google's end? Or is there something I can change to make this work?
[QUOTE=Sylerr;45316365]What's a good reliable to too expensive website host?
Looking to host my portfolio on a wordpress platform or should I just go for go daddy[/QUOTE]
[URL="http://www.deroyalservers.com/"]DoRoyal[/URL] has really nice support and mad cheap.
I used to use Lithium, they however disappointed me in the end.
(I don't use DoRoyal, but they gave me 4 months free hosting because they were unsure about something and wanted to make up for it, so that's a plus :v:)
Sorry, you need to Log In to post a reply to this thread.