wordpress,localhost,admin,local,syntax-errorRelated issues-Collection of common programming errors
Juhana
javascript wordpress ads banner geotargetting
Do you know of any way to do it? real example…?I am looking for a free service like maxmind or others (I really don’t care what) and I would like to have a different ad for US visitors.Thanks a lot!2astalavista: Your example works fine. This is what I did and it’s still not working.<html> <head> <title>Geo Test</title> <script type=’text/javascript’ src=’http://www.101greatgoals.com/wp-includes/js/jquery/jquery.js?ver=1.7.1′></script> <script> $(docume
user225269
php wordpress obfuscation wordpress-plugin-dev ioncube
I’m trying to obfuscate the WordPress plugin that I created using Ioncube since its the requirement of the company. Things I already tried:directly including the wordpress comment header on the encoded file create another php file that will contain the comments for wordpress to be able to be aware of the plugin and then include it via include_once() in the main plugin file (ecom.php). tried .inc, .txt, no file extension but WordPress doesn’t recognize the pluginBut I’m getting the following err
Mat-visual
php wordpress
i have a custom query and i want to know how i can add an if statement, so that if there is no posts for this query, a simple message gets displayed.My query:<ul class=”posts”><?php if ( $spQuery->have_posts() ) while ( $spQuery->have_posts() ) : $spQuery->the_post(); ?><li><?php the_post_thumbnail( ‘themename-bw-image’ ); ?></li><?php endwhile; wp_reset_postdata(); ?></ul>I was trying this:<ul class=”posts”><?php if ( $spQuery->have
hakre
wordpress php
Parse error: syntax error, unexpected ” (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in …This is the error that I’m getting<?phpfunction my_custom_js() {echo ” <script>” ;echo ” jQuery(document).ready(function(){ jQuery(‘#secondary-front .first h3’).addClass(‘<?php $options = get_option(‘mytheme_theme_options’); if(!empty($options[‘first_widget_icon’])) echo $options[‘first_widget_icon’]?> ‘);jQuery(‘#secondar
Daniel Skowronski
php wordpress
This question already has an answer here:PHP syntax for dereferencing function result [duplicate]22 answersI just moved WordPress website from Dev Environment to Production Hosting Environment. The first one is Windows Dev, the second is Linux Managed Hosting (only management panel + ftp). All works as expected without sites that has in their custom code line like this:<?php echo get_field_object(‘social’)[‘label’]; ?>This code is used by plug-in Advanced Custom Fields. On my Dev thre is n
nathandrake
javascript php html css wordpress
I created custom home page whose name is “front-page.php” and than added another page with custom css and JS files like this in the header.php file: <?php function my_styles_method() {if (is_page_template(‘front-page.php’==TRUE){ // Register the style like this for a theme: wp_register_style( ‘my-custom-style’, get_template_directory_uri().’/includes/marquee.css’); // enqueue the stule wp_enqueue_style( ‘my-custom-style’ ); }enter code here// Register the style like this for a theme: i
Fred -ii-
php wordpress
I’m using wordpress, and I’m having a hard time with a simple php code I want to add in footer.php to display a “|” symbol with 20px of margin and a url only on the site frontpage:<?php if(is_front_page()){echo “<span style=’margin: 0 20px;’>|</span><a href=”http://www.w3schools.com” target=’_blank’ title=’W3C’>Visit W3Schools</a>”; } ?>The following characters are displayed in green by my txt editor as if they were comments:” target=’_blank’ title=’W3C’>Visit W3
js111
php wordpress
I’m working with a WordPress theme (genesis framework) and i need to input a php snippet into the post meta function (right after post_edit). I cannot seem to get this to work without throwing an error. This is the function I need to work with:add_filter( ‘genesis_post_info’, ‘sp_post_info_filter’ ); function sp_post_info_filter($post_info) {$post_info = ‘[post_date] by [post_author_posts_link] [post_comments] [post_edit]’;return $post_info; }And this is the PHP snippet I need to use<?php ech
Keith Groben
php wordpress
This is the portion of code surrounding the issuefunction twitter_count($twitter_id, $widget_id, $clear_cache) {$twittercount = 0;if(get_option(‘twitter_count_’ . $widget_id) == 0 || $clear_cache == ‘on’ || get_option(‘twitter_count_api_timer_’ . $widget_id) < (time() – 1800)): $followers = $this->curl(“http://twitter.com/users/show.xml?screen_name=” . $twitter_id);try {if($followers):$xml = new SimpleXmlElement($followers, LIBXML_NOCDATA);if($xml):if((string)$xml->followers_count):$twi
Marcin Orlowski
php wordpress echo image
I’m trying to echo an image from my ‘_images’ folder, but if I write the following code, it is only for my website:echo ‘<img src=”http://mywebsite.com/mytheme/wp-content/themes/my theme/_images/project3image1.jpg”>’;I’ve changed it to this so when someone else uses my theme, it takes them to their own website directory:echo ‘<img src=”<?php bloginfo(‘stylesheet_directory’); ?>/_images/project3image1.jpg”>’; But there must be something wrong with this code when I put that and p
pc1oad1etter
.net web-services localhost
I have a .net service that runs an HTTPListener on port 8080.In this scenario, we are running a client on the same machine as the server, connecting at localhost:8080.On our demo machine (great!), when the internet is not connected, all connections to the server fail.I do have two errors in my logs:The I/O operation has been aborted because of either a thread exit or an application request at System.Net.HttpListener.EndGetContext(IAsyncResult asyncResult)ANDUnexpected error: The handle is inva
gelly
node.js angularjs socket.io localhost
I’m using an AngularJs, node & socket.io to write an app where I want to have some shared data in my different clients. I’m looking at this example: https://github.com/mhevery/angular-node-socketioI get everything up and running and it works fine if I go to the location of my index.html in my file system (c:/user/angularnodesocket/index.html), but when I go to localhost:8888 the site still shows but the angular stuff is not interpretated.I get this error on localhostResource interpreted as S
just a learner
c# .net iis localhost image-uploading
I have to save images to a folder located in “c:\inetpub\wwwroot\” and named as “UploadedImages”. Here is my code: public string SaveImage(string base64,int compno) {string res = “”;try{using (MemoryStream ms = new MemoryStream(Convert.FromBase64String(base64))){using (Bitmap bm2 = new Bitmap(ms)){bm2.Save(Server.MapPath(“~/UploadedImages/ID”+compno+”.jpg”));}}res = “done”;}catch (Exception ex) {res = ex.ToString();}return res; }but it throws “A generic error occured in GDI+ at System.Drawing.Im
Tshepang
html5 node.js localhost
I’ve been trying to run Askys version of BrowserQuest on my local machine – but without any luck.Im getting the following errors when im trying to start the server:server/js/databasehandler.js error message:var cls = require(“./lib/class”),Player = require(‘./player’),Messages = require(“./message”),redis = require(“redis”),client = redis.createClient(xxxx, xxxx, {socket_nodelay: true});I also tried to change xxxx xxxx to port and host of my redis server (databasehandler.js file), when I’m getti
amitasthana
apache .htaccess webserver localhost
This is a unexpected error, what should i do my localhost is redirceting tohttp://www.yoursite.com/307.phpWhen i try to open localhost or 127.0.0.1 pr my LAN address 192.168.1.103 i am being redireted tohttp://www.yoursite.com/307.phpi also tried 127.0.0.1 and also my LAN addressi have checked etc/hosts…, nothinng is there?Please help somebody
Leo Lou
node.js websocket localhost port webrtc
I get the source code of a great webrtc demo from https://github.com/webRTC/webrtc.io-demoand the demo site is: webrtc.dennis.isIt works fine when I start a local node server, but when I upload the demo to a node server online( www.appfog.com ), I come into an unexpected bug which says :WebSocket connection to ‘ws://talktosomeone4.ap01.aws.af.cm/’ failed: Unexpected response code: 200 talktosomeone4.ap01.aws.af.cm:1At first I think maybe it’s caused by missing port,so I try to complete the webso
user2683951
joomla localhost syntax-error
Need a little help here. It would be greatly appreciated. I’m helping out a friend on her project that she got from a client and keep getting this error. Were using the localhost.Error: Parse error: syntax error, unexpected $end, expecting T_FUNCTION in C:\xampp\htdocs\OurCammbackup\libraries\joomla\error\error.php on line 53Code: <?php /*** @package Joomla.Platform* @subpackage Error** @copyright Copyright (C) 2005 – 2012 Open Source Matters, Inc. Allrights reserved.* @license GNU
Craig
wordpress localhost admin local syntax-error
I have a local install of WordPress running & I am suddenly getting these errors in my console:Uncaught SyntaxError: Unexpected token ILLEGAL media-upload.php:75Uncaught ReferenceError: jQuery is not defined media-upload.php:89Uncaught ReferenceError: SWFUpload is not defined media-upload.php:156Uncaught ReferenceError: jQuery is not defined load-scripts.php:1Uncaught SyntaxError: Unexpected token ILLEGALNon-wordpress site’s work fine and I’ve never had any issues like this before, it seems
skgsergio
networking debian localhost
I’m having a problem with a dedicated server, I don’t known if it’s the default behavior but this is the problem:If I connect to a service located on the server with localhost the service gets as source IP the external IP.Let me show an example, I use netcat for listening on 127.0.0.1:4444xxxxxx # nc -vv -l -s 127.0.0.1 -p 4444 listening on [127.0.0.1] 4444 …Lets check if it’s ok:xxxxxx ~ # netstat -atnp | grep 4444 tcp 0 0 127.0.0.1:4444 0.0.0.0:* LISTEN
Matias Nino
firewall router localhost
Our web server was just switched to a V-LAN with some very strict firewall rules. Basically they closed every inbound and outbound port unless we specifically needed it. We have some services running locally on the server that handle requests on specific ports (58585 and 45454), but the requests are made by the web application itself to 127.0.0.1. This stopped working once they switched our web server to the new V-LAN. Is it possible the router can actually BLOCK localhost traffic? Windows Firew
Henri
django admin
I have a database table with e.g. a weight value e.g.CREATE TABLE product (id SERIAL NOT NULL,product_name item_name NOT NULL,..weight NUMERIC(7,3), — the weight in kg..CONSTRAINT PK_product PRIMARY KEY (id) );This results is the model:class Product(models.Model):.weight = models.DecimalField(max_digits=7, decimal_places=3, blank=True, null=True).I store the weight in kg’s, i.e. 1 kg is stores as 1, 0.1 kg or 100g is stored as 0.1To make it easier for the user, I display the weight in the Adm
Scotty Allen
django inline admin django-signals foreign-keys
I have extended Django’s User Model using a custom user profile called UserExtension. It is related to User through a unique ForeignKey Relationship, which enables me to edit it in the admin in an inline form! I’m using a signal to create a new profile for every new user:def create_user_profile(sender, instance, created, **kwargs): if created:try: profile, created = UserExtension.objects.get_or_create(user=instance)except:pass post_save.connect(create_user_profile, sender=User) (as described
Brett
wordpress plugins admin posts
My wordpress admin is showing 0 posts, pages, categories, & tags. However, everything is appearing on the frontend just fine. I’m running wordpress 3.0 and as far as I know no settings have been changed, plugins upgraded, etc since this began happening.Also, when searching for plugins I get the error “An Unexpected HTTP Error occurred during the API request.” I’m assuming this is related to the first problem, but it may not be.Thanks in advance for any help.
Nick Cox
php session admin
I am using a header file with the following code: <?php$ADMIN = False;if(session_id() == ”) {// session has NOT been startedsession_start();}else{// session has been started}?>The code I have to check the state of the admin variable is this :while ($row2 = mysql_fetch_array($account_type)){if($row2[‘account_type’] == ‘A’){$ADMIN = ‘true’;}else{$ADMIN = ‘false’;}and every time I try to access the page with the site on I get an error:Parse error: syntax error, unexpected ‘$ADMIN’ (T_VARIABL
Binarybit
menus wp-admin admin
I am getting a bit frustrated over here after having spent a few hours trying to accomplish this fairly simple task without any luck.Essentially I have 5 custom post types which I created and all I want to do is show each of them in a specific order directly under the “dashboard”.From the WordPress documentation it seems that you can’t really do this because the highest menu order seems to be “5”. And above LI am guessing some expert reading this can show me the simple way that I can order the a
dgw
wp-admin admin sort
On a related note to “Changing the Order of Admin Menu Sections?”, I’m looking for a way to alphabetically sort the entries in each sub-section of WordPress’s admin area.Currently, whenever a new plugin is added, its entry will appear in a seemingly random location under Settings / Tools / Plugins, and it’s often hard to locate the new menu item. (I have a lot of plugins already, so my menus are pretty full.)Being that I add and remove plugins fairly regularly, I would rather not need to continu
Mayeenul Islam
admin css stylesheet
I think that I am missing something…I am trying to customize the look and feel of the admin section of my site. A lot of my style are working as expected, but when I try to change the height of inputs, I am getting unexpected results.As an example, if I go into the backend of my WordPress installation, with all of my styles disabled, and use FireFox’s ‘Inspect Element’ functionality to change the height of a specific text box to, say, 30px, it goes from 12px to 22px. When I change it to 20px
Ari Susanto
admin css wp-options
I am trying to include a dynamic css in my plugin, I have been searching anywhere but doesn’t find any case that is similar to what I do. And what I use to do it is by adding a css file directly into the end of my plugin php file after the closing php tag ?> without adding any other stuffs like calling wp head etc.Here is the example of the code I put directly into the end of my plugin’s file:<style type=”text/css”>.innertrow { background-color: <?php get_options(‘css_value’);?>}&
Craig
wordpress localhost admin local syntax-error
I have a local install of WordPress running & I am suddenly getting these errors in my console:Uncaught SyntaxError: Unexpected token ILLEGAL media-upload.php:75Uncaught ReferenceError: jQuery is not defined media-upload.php:89Uncaught ReferenceError: SWFUpload is not defined media-upload.php:156Uncaught ReferenceError: jQuery is not defined load-scripts.php:1Uncaught SyntaxError: Unexpected token ILLEGALNon-wordpress site’s work fine and I’ve never had any issues like this before, it seems
hakre
php yii admin
I am trying to implement the directory structure from the yii wiki http://www.yiiframework.com/wiki/33/I have everything setup properly I believe but when I try to use the urlManger within the backend/config/main i recieve this error.Property “CWebApplication.urlManager” is read only//backend/config/main.php<?php $backend=dirname(dirname(__FILE__)); $frontend=dirname($backend); Yii::setPathOfAlias(‘backend’, $backend);return array(‘basePath’ => $frontend,’controllerPath’ => $backend.’/c
user1316570
c azure blob local hidden
AzureXplorer – local blob storage – unexpected hidden fies when manually creating foldersOur C# ListBlobs method that works OK up in Azure revealed one extra file per folder locally named “$$$.$$$” that are not visible in AzureXplorer or ClumsyLeaf. Neither Google nor MSDN has turned up any note of this so I was wondering if any one else has seen this. The workaround for this defect in AzureXplorer is to manually create local blob folders with ClumsyLeaf which does NOT produce these hidden fil
Craig
wordpress localhost admin local syntax-error
I have a local install of WordPress running & I am suddenly getting these errors in my console:Uncaught SyntaxError: Unexpected token ILLEGAL media-upload.php:75Uncaught ReferenceError: jQuery is not defined media-upload.php:89Uncaught ReferenceError: SWFUpload is not defined media-upload.php:156Uncaught ReferenceError: jQuery is not defined load-scripts.php:1Uncaught SyntaxError: Unexpected token ILLEGALNon-wordpress site’s work fine and I’ve never had any issues like this before, it seems
Udo Held
debugging websphere local rad portal
I have been looking around on the internet how to setup a local Portal environment together with the RAD IDE, I found threads like this but that’s a thread of the ancient history (speaking in IT terms) or only refers to optimizing Portal with RAD (here). Currently I have RAD 8.0.4.1 running and I can run a WAS-instance, but I can’t manage to get the Portal-environment run locally. I read that in the past there was some sort of specific Portal Test Environment, but with the newer RAD do I have to
Ólafur Waage
c# reference runtime local
I have a C# project that uses a dll. I added the dll to project references and I set the property Copy Local to False (I do not want to have local copies of that dll). The compilation looks fine, but when I try to run the C# application, it cannot find the dll. Where can I tell the project where to look for the library during runtime?Thanks
skaffman
asp.net javascript vb.net directory local
Is it possible for a webpage to popup a open folder dialog, ask the user to select a folder, then show the contents of that folder in a list(or something) in the webpage. It won’t write to the files, only read them. The webpage is hosted remotely.Jonathan
0x499602D2
c++ memory-management static local
What happens to a static variable when returned as a reference and passed as a pointer directly to another function? Obviously, the variable persists after the function returns, but something about this whole concept just bothers me. At which point is the memory on the data-sequent, occupied by the static variable, freed? Does the runtime magically notice when I no longer need it, like some kind of garbage collection?To give an example:SDL_Rect* XSDL_RectConstr(int x, int y, int w, int h) {stati
Rachel Martin
asp.net gridview timezone local
I have a DateTime stored in UTC time that I’d like to display to the user in their local time from within a GridView control. How can I convert my DateTime to the user’s time (not my server’s local time)? Here is my current field as it appears in the GridView Columns collection:<asp:BoundField DataField=”RunTime” HeaderText=”Run Time”SortExpression=”RunTime” DataFormatString=”{0:f}” />
user1111929
local opencl
Sometimes openCL kernels have in their parameterskernel someName (some globalparameters, __local int* myArray) {while other scripts have somewhere inside the kernel__local int myArray[length];what is the difference between these? I thought they were only syntactic differences, but now I see inside one of the official AMD samples (RadixSort) the comment __local KV_TYPE localDataArray[TPG*4*2]; // Faster than using it as a parameter !!!so apparently I was wrong. And effectively, when I try it in m
james
variables initialization local
JPanel p2 = new JPanel(new GridLayout(6,1)); ButtonGroup tubtype = new ButtonGroup(); JRadioButton roundrButton = new JRadioButton(“Round”, true); tubtype.add(roundrButton); JRadioButton ovalrButton = new JRadioButton(“Oval”, false); tubtype.add(ovalrButton); calcButton = new JButton(“Calculate Volume”); exitButton = new JButton(“Exit”); hlength = new JTextField(5); hwidth = new JTextField(5); hdepth = new JTextField(5); hvolume = new JTextField(5); lengthLabel = new JLabel(“Enter the tub’s leng
user1619482
azure resources local
We are using azure local storage for processing temporary files. These temporary files would be uploaded to the local storage through application. For that I have configured the following code in ServiceDefinition.csdef file.local resources LocalStorage name=”ELearningSpace” sizeInMB=”2000″ cleanOnRoleRecycle=”true” Local resourcesWe have used the following code to access the local storage of azure instance LocalResource uploadFolder = RoleEnvironment.GetLocalResource(“mylocalStore”); file.Save
Scott B
php syntax-error ini
The function below takes the “test-backup.ini” file, parses it and inputs the values into the DB via the update_option() method.However, when the ini file’s values contain special characters like exlamation points (!) and equal signs (=) (and others I would guess), its throwing a PHP syntax error at parse_ini_file($file):Syntax error, unexpected “!”, etc…For example, given this content as the test-backup.ini file…[settings] line1 = asc line2 = /*.blog ul li {margin-bottom:0 !important;}*/ li
Sam
ruby-on-rails ubuntu amazon-ec2 syntax-error capistrano
Several people have asked fairly similar questions to this, so I’m sorry to repeat ‘old questions’ but I’m completely stuck atm. I’ll try to make it as clear as possible what the problem is:I have a rails app that works locally. I am using capistrano to try to deploy it on an ubuntu EC2 instance.After wading through previous problems, I’m coming up against this when running the’cap deploy’ command (I removed the ec2 server name):executing “cd — /u/apps/tweet_app/releases/20130628110910 &&a
Jeremiah Willcock
prolog syntax-error swi-prolog
I’m new to SWI-Prolog and am trying some tutorials. Every file I try to load through the command line, however, gets 2 error messages – one at the start (Operator expected) and one at the end (Unexpected end of file). Files are saved in the same directory as the one I’m working in.For example, I have this file saved as kb2.pllistensToMusic(mia). happy(yolanda). playsAirGuitar(mia) :- listensToMusic(mia). playsAirGuitar(yolanda) :- listensToMusic(yolanda). listensToMusic(yolanda):- happ
insomnia
php syntax-error
I am trying to use This PHP Mail form,http://jemsmailform.com/and I keep getting syntax errors on 2 different lines. Line 70, and 72. This is what is on those lines.if (isset($requiredFields[‘name’]) && !empty($_POST[‘name’]) !preg_match(“/^[a- zA-Z-‘\s]*$/”, stripslashes($_POST[‘name’])))$error_msg .= “The name field must not contain special characters.\r\n”;if (isset($requiredFields[’email’]) && !empty($_POST[’email’] && !preg_match(‘/^([a-z0-9])(([-a-z0-9._])*([a-z0-
andrewtweber
php debugging syntax-error
I don’t know what’s going on with my PHP. I’m using a bunch of classes and a semi-MVC framework that I developed myself (as an experiment). So the PHP file is including a lot of class files.My PHP line numbers for error messages are completely off and therefore useless and making it impossible for me to debug. For example, right now I’m getting an error message that says:`Parse error: syntax error, unexpected ‘)’ in /view.php on line 209The only problem is: there is no ‘)’ anywhere near line 209
Benjamin
php function foreach return syntax-error
I have a simple function:function name() {extract( myfunction_atts( array(‘one’ => ”, ‘two’ => ”, ), $atts ) ); /* CODE */return $output; /* return dataName(); in second case */ }Now, I want the return to output this code:$output .= include_once(ADDRESS_CONST.”/script.php”);$output .= $data = data($one); $output .= foreach($data->do($two) as $e) {;$output .= $e->info;$output .= } ; Gives syntax error, unexpected T_FOREACH.So I need a function, the point is:function dataName()
hakre
syntax-error php brackets
Trying to put some slightly tricky form validation (in this instance for checkboxes) in relation to a sign up form for a tennis tournament <?php if ( ( isset($_POST[‘ms’])&&isset($_POST[‘ws’]) )|| (isset($_POST[‘mc’])&&isset($_POST[‘ws’]))|| (isset($_POST[‘md’])&&isset($_POST[‘ws’]))|| (isset($_POST[‘ms’])&&isset($_POST[‘wc’]))|| (isset($_POST[‘ms’])&&isset($_POST[‘wd’]))|| (isset($_POST[‘mc’])&&isset($_POST[‘wc’]))|| (isset($_POST[‘mc’])&
Wes Carr
twitter-bootstrap heroku gem syntax-error gemfile
After numerous “git push heroku master” rejections due to “no Cedar-support app detected” I found I should run bundle install. $bundle installGemfile syntax error:<<<<<<< HEAD^/Users/Wes/Sites/code/omrails/Gemfile:21: syntax error, unexpected ===, expectingkeyword_end=======^Alright, checking Gemfile: source ‘https://rubygems.org’gem ‘rails’, ‘3.2.13’ gem ‘jquery-rails’group :production dogem ‘pg’ endgroup :development, :test dogem ‘sqlite3’ endgroup :assets dogem ‘sass-rail
Lali Pali
javascript jquery function object syntax-error
I am wondering what is wrong with this code, it throws a Syntax Error: unexpected token “anotherFuction if I add the anotherFunction part. Can someone please explain why, JavaScript is confusing me so much with all this different ways calling functions. var ajax = {parseJSONP : function(result) {console.log(result)//iterate each returned item$.each(result.items, function(i, row) {$(‘#listview_test’).append(‘<li><a href=”#headline”><img src=”‘ + row.volumeInfo.imageLinks.thumbnail
Xaqron
php syntax-error wampserver
This is not the first time I feel WAMP Server is too sensitive on errors. It seems there should be some configurations to decrease it’s sensitivity to PHP errors. I have a script which is run normally on Linux production server (CENTOS 5.8 + Apache + MySQL) but when executed by WAMP server on Windows 7 Ultimate(64bit) the following error is shown:syntax error, unexpected end of file in …Here I’m not curious about the condition this error occures (I did Google it and find out why it ocurs), my
Web site is in building