london-G Light Poster

I want to echo the url which includes an onlick property. Here is my code below:

function royal_sidebutton_body_tag_html() {

    // get plugin option array and store in a variable
    $royal_sidebutton_plugin_option_array   = get_option( 'royal_sidebutton_plugin_options' );

    // fetch individual values from the plugin option variable array
    $royal_sidebutton_text_for_tab          = $royal_sidebutton_plugin_option_array[ 'text_for_tab' ];
    $royal_sidebutton_tab_url               = /*$royal_sidebutton_plugin_option_array[ 'tab_url' ]; */ 'https://www.example.co.uk">';
    $royal_sidebutton_target_blank          = $royal_sidebutton_plugin_option_array[ 'target_blank' ];

    // set the page target
    if ($royal_sidebutton_target_blank == '1') {
        $royal_sidebutton_target_blank = ' target="_blank"';
    }

    // Write HTML to render tab
    echo '<a href="' . esc_url( $royal_sidebutton_tab_url ) . '"' . $royal_sidebutton_target_blank . '><div id="royal_sidebutton_tab" class="royal_sidebutton_contents royal_sidebutton_left">' . esc_html( $royal_sidebutton_text_for_tab ) . '</div></a>';
}

I have tried to add

a href="//www.example.co.uk/login.aspx" target="_blank" title="Login" onclick="popitup(); return false;"

to the variable "$royal_sidebutton_tab_url" but it does not work. It just adds it to the link.

london-G Light Poster

Hi Guys,

Hope you are enjoying the summer!

I am having some trouble with the code below. It is feeding blog posts from another website and linking them to a website.

The code works fine. However I need to change the hyperlink(uri) to another domain.

<li><a href="<?php echo $feed[$i]->uri; ?>" target="_blank">
            <div class="feed-link image"><img src="<?php echo $feed[$i]->itemimage; ?>" alt="<?php  echo $feed[$i]->title; ?>" width="223" height="148"/></div>
            <div class="feed-link title"><?php echo $feed[$i]->title; ?></div>
            <?php
                $content_for_text = JFilterOutput::cleanText($feed[$i]->content);
                /*$content_for_text = preg_replace('/&.*?;/', '', $content_for_text);*/
                $content_for_text = preg_replace('/&/', '', $content_for_text);
                $content_for_text = preg_replace('/amp;/', '', $content_for_text);
                $content_for_text = preg_replace('/#.*?;/', '', $content_for_text); 
                $content_for_text = JHtml::_('string.truncate', $content_for_text, 220);
            ?>
            <div class="feed-link content"><p><?php echo $content_for_text; ?></p></div>
            <div class="bt_more">Read more&ensp;&ensp;&or;</div>
            </a></li>
london-G Light Poster

Hi Guys,

I am currently trying to find out what the problem might be here:

I basically want the other circle to display the images properly like in the first circle.

My code is as below:

HTML

<head><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/component.css" /><script src="js/modernizr.custom.js"></script></head>

        <div class="container"> 
            <!-- Codrops top bar -->
            <div class="codrops-top clearfix">

            </div><!--/ Codrops top bar -->
            <header class="clearfix">

            </header>
            <div class="main">
                <div id="fc-slideshow" class="fc-slideshow">
                    <ul class="fc-slides">
                        <li><img src="images/3.png" /></li>
                        <li><img src="images/4.png" /></li>

                    </ul>
                </div>
            </div>
        <div class="main">
                <div id="fc-slideshow_two" class="fc-slideshow_two">
                    <ul class="fc-slides">
                        <li><img src="images/3.png" /></li>
                        <li><img src="images/4.png" /></li>

                    </ul>
                </div>
            </div>

        </div><!-- /container -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
        <script src="js/jquery.flipshow.js"></script>
        <script>
    $( function() {
$.Flipshow.prototype.navigate=function(element,direction){
this._navigate(element,direction);
};
$("#fc-slideshow").flipshow();
setInterval( function() {
$('#fc-slideshow').flipshow('navigate',$("#fc-slideshow div.fc-right span:first"),'right');
}, 3000);
$( '#fc-slideshow').flipshow();
} );
    $( function() {
$.Flipshow.prototype.navigate=function(element,direction){
this._navigate(element,direction);
};
$("#fc-slideshow_two").flipshow();
setInterval( function() {
$('#fc-slideshow_two').flipshow('navigate',$("#fc-slideshow_two div.fc-right span:first"),'right');
}, 3000);
$( '#fc-slideshow_two').flipshow();
} );

        </script>

Javascript :

/**
 * jquery.flipshow.js v1.0.0
 * http://www.codrops.com
 *
 * Licensed under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * Copyright 2013, Codrops
 * http://www.codrops.com
 */
;( function( $, window, undefined ) {

    'use strict';

    // ======================= imagesLoaded Plugin ===============================
    // https://github.com/desandro/imagesloaded

    // $('#my-container').imagesLoaded(myFunction)
    // execute a callback when all images have loaded.
    // needed because .load() doesn't work on cached images

    // callback function gets image collection as argument
    //  this is the container

    // original: mit license. paul irish. 2010.
    // contributors: Oren Solomianik, David DeSandro, Yiannis Chatzikonstantinou

    // blank image data-uri bypasses webkit log warning (thx doug jones)
    // blank image data-uri bypasses webkit ...

Thanks Gentlemedia! That's sorted now.

Hi Gentlemedia :),

I cannot see where the 660px comes from. I have checked my CSS files but cannot find it.

london-G Light Poster

Hello Guys,

I have been hopelessly trying to make the sidebar full height on this site. When the content expands, its height stays the same.

Site

Any idea how I can do that?

Is there a way I can find out what the issue is?

I have tried debugging but I don't think there is anything wrong with the code. Although it still isn't working.

Thanks Gentlemedia. I have made some research about the error but could not find anything.

I am not sure how I am going to fix this issue.

Thanks gentlemedia!

I have amended this part. I cannot see anymore errors on firebug however it seems that the code is still not working.

This code was added in order to track certain events on the site such as button clicks ect... and report back to Google Analytics. There is currently no data in analytics.

london-G Light Poster

Hi Guys,

I have added a script to my website template and somehow it does not work.

I think this could be due to a JS conflict but when using firebug, I cannot see anything abnormal.

Here is the link:

Link

My JS code is as follow

    $.noConflict();
$(document).ready(function ($) {
    // Using jQuery Event API v1.3
  $('#quote_home').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_home');
  });
  $('#quote_landlord').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_landlord');
  });
  $('#quote_lerg').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_lerg');
  });
  $('#quote_business').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_business');
  });
  $('#quote_tenant').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_tenant');
  });
  $('#quote_holidayhome').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_holidayhome');
  });
  $('#quote_referencing').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_referencing');
  });
  $('#quote_mortgages').on('click', function() {
    ga('send', 'event', 'a', 'click', 'quote_mortgages');
  });
});

I am calling the file using this line:

$doc->addScript('templates/protostar/js/tracking.js'); //Google tracking Event Script
london-G Light Poster

Hi,

I converted a as3 file into a html5 file using swiffy tools offered by google.

My code is below:

 var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
          swiffyobject, {});
      stage.setFlashVars("clickTAG=%%CLICK_URL_ESC%%%%DEST_URL%%");
      stage.start();

It works fine but I want to link the stage to a new page. Any idea how I can achieve this?

Thanks

london-G Light Poster

We have a site which unfortuntely is not responsive.

I was asked to make it responsive, however I am faced with a few options

  1. Develop/design a new site espacially for mobile use and redirect it when needed
  2. It seems that I can use CSS to make the website appear diffrently when on a mobile phone

What would you think is the best approach for this?

I found out the problem. Semi colon was missing on line 29.

Thanks!

Showing the options.

I have a question and options displayed as radio buttons. However it is not showing them.

The next part shows a graph(pie chart) sowing the count of the votes.

london-G Light Poster

Hello,

I have this code here. I am trying to show the different options with radio box.

There is something wrong in my code, however I can't figure out what it is. Any help?

<div id="questions">
  <p><img src="images/pic_survey.jpg" width="279" height="104"  alt=""/></p>
  <p>Please take our five second survey!</p>
  <h3 class="hSubtitle">Question 1</h3>
  <div class="question">
  </div>
    <input type="button" value="Submit" class="bt_send" id="old_votes_send">
</div>
<div class="result clearfix">
<h3 class="hSubtitle">Question 1</h3>
  <div id="canvas-holder">
    <canvas id="chart-area" width="200" height="200" style="width: 200px; height: 200px; margin-left:-10px;">
  </canvas></div>
  <ul class="doughnut-legend">
  </ul>
</div>
<script>
  $(function() {

    var doughnutData = []
    var style =
    { "1-2 years": { color: "#FDB45C",
        highlight: "#FFC870" },
      "2-4 years": { color:"#F7464A",
        highlight: "#FF5A5E" },
      "5-7 years": { color: "#46BFBD",
        highlight: "#5AD3D1" },
      "7+ years": { color: "#4d5360",
        highlight: "#5c6473" }}

    $("#old_votes_send").click(function(){
      var option_id = $('input:radio[name=old_votes]:checked').attr("option_id");

      $.post("http://localhost/v1/questions/2/options/" + option_id + "/votes",
        { comment: "", vote_source: "main web site" },
          function(){}
      ).always(function() {
          show_chart();
      });
    })
    var get_options_data = function(){
      $.ajax({
        type: 'GET',
        url: "http://localhost/v1/questions/2/options",
        dataType: 'json',
        success: get_options_data_success,
        error: "Error"
      });
    }
    var get_options_data_success = function(data){
      doughnutData = [];
      $.each(data, function( index, value ) {
        var id = value["id"];
        var description = value["description"];

        var vote_counts = value["votes_count"];
        if (vote_counts == "null") vote_counts = 0;
        doughnutData.push(
          { id: id,
            value: vote_counts,
            color: style[description]["color"],
            highlight: style[description]["highlight"],
            label: description }
        );
      });
      show_options();
    }
    var show_chart = function(){
      $('#questions').hide();
      $('div.result').show();
      show_options_color();
      draw_doughnut();
    }
    var show_options = function(){

      $(".question").empty();

      $.each(doughnutData, function( index, value ) {
        label = value["label"];
        id    = value["id"];
        var radioBtn = $('<p><input type="radio" name="old_votes" option_id="' + id + '" ...
london-G Light Poster

Hi Guys,

I am actually trying to achieve data replication across two databases(SQL). I have researched into different techniques; synchronous vs asynchronous

I have seen that there is a way of doing it using PHPMyAdmin however I am wondering if it is synchronous vs asynchronous?

london-G Light Poster

Hello,

I am developing a database system and as part of a project I have been asked to look into fault tolerance.

From what I understand a fault tolerant program is a program that is not vulnerable to errors.

Any ideas how I can ensure that the program I am buiding is fault tolerant.

My guess is that if I use exeptions for every methods in my classes that will make my system fault tolerant?

Thanks

london-G Light Poster

Hi Guys,

I have developed a multi language website and basically the urls are all in English. I remember reading an article which mentioned that urls did not much have importance with SEO.

I am now starting to wonder if that's really the case?

What are you thoughts?

london-G Light Poster

Hi!

Basically I am trying to add the graph inside the Jpanel which already exists. I am getting the erorr "adding a window to a container"

Here is my code

 public void displayGraph(){

    try{
       String sql = "Select pressure, ventilage from statstbl";
DBCon conn = new DBCon();
       JDBCCategoryDataset dataset = new JDBCCategoryDataset(conn.connect(),sql);
       JFreeChart chart = ChartFactory.createLineChart("Chart", "Pressure", "Ventilage", dataset, PlotOrientation.VERTICAL, false, true, true);
       BarRenderer renderer = null;
       CategoryPlot plot = null;
       renderer = new BarRenderer();
       ChartFrame frame = new ChartFrame("Statistics",chart);
 jPanel3.add(frame, BorderLayout.CENTER);
 jPanel3.validate();
       frame.setVisible(true);
       frame.setSize(500,650);

   }catch(Exception ex){
       JOptionPane.showMessageDialog(null,ex.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);
   }

    }

stultuske,

I have now specified the value for the parameter and changed the code again. However I am getting the same error : Column 'salary' not found.
I have checked my table names as well as the columns. I can't see anything wrong.

The table name is orders, the column salary...and the other colunm is cus_name

ALright I have changed my code a bit:

public void total(){

        Properties conProps = new Properties();
          conProps.setProperty("user", "user");
        conProps.setProperty("password", "pass");
     try {
             con = DriverManager.getConnection("jdbc:mysql://91.208.99.2:3379/link", conProps);
                con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);

            } catch (SQLException ex) {
                Logger.getLogger(AddProduct.class.getName()).log(Level.SEVERE, null, ex);
            }

    String query=("SELECT SUM(salary) FROM orders WHERE cus_name = ?");

   try {   
          con.setAutoCommit(false);
         st = (com.mysql.jdbc.PreparedStatement) con.prepareStatement(query);
            st.executeQuery();
            rs = st.getResultSet();
              while (rs.next()) {
    st.setString(1,customer.getSelectedItem().toString());   
         String tot = rs.getString("salary");

                jLabel3.setText(tot);

   }
  }catch (  SQLException e) {
    e.printStackTrace();
  }

}

the error I am getting is java.sql.SQLException: No value specified for parameter 1

I have sepecified the value for parameter one.

Could it be because salary in my db is an integer?

london-G Light Poster

I am trying to retieve the total salaries from a table where the customer name is X. I have the code below however there seems to be an error.

    public void total(String name){
  double totals=0;
  Properties conProps = new Properties();
          conProps.setProperty("user", "user");
        conProps.setProperty("password", "pass");
     try {
             con = DriverManager.getConnection("jdbc:mysql://91.208.99.2:3379/link", conProps);
                con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
            } catch (SQLException ex) {
                Logger.getLogger(AddProduct.class.getName()).log(Level.SEVERE, null, ex);
            }

    String query=("SELECT SUM(salary) FROM orders WHERE cus_name = ?");

   try {   
          con.setAutoCommit(false);

                st = (com.mysql.jdbc.PreparedStatement) con.prepareStatement(query);
    st.setString(1, name);
    ResultSet salaries=st.executeQuery();
    while (salaries.next())    
       totals+=salaries.getDouble("salary");

  }catch (  SQLException e) {
    e.printStackTrace();
  }
 System.out.println("Sum of column = " + totals);
}

I am getting Error:
java.sql.SQLException: Column 'salary' not found. I can confirm that the column salary is in the table..

Thanks Guys,

As advised, I changed it to a textfield and set it a value. It worked!

london-G Light Poster

Hi Guys,

I am getting an error:

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "jLabel4"

With this code:

        public void insertCustomer() {
            Properties conProps = new Properties();
          conProps.setProperty("user", "user");
        conProps.setProperty("password", "pass");
         int q = Integer.parseInt(jLabel4.getText());

     try {
             con = DriverManager.getConnection("jdbc:mysql://91.208.99.2:3379/5thfloor_pos", conProps);
                con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
            } catch (SQLException ex) {
                Logger.getLogger(AddProduct.class.getName()).log(Level.SEVERE, null, ex);
            }

            String sql = ("INSERT INTO order_prty(customer, barcode, total) VALUES (?,?, ?)");

            try {

                con.setAutoCommit(false);

                st = (com.mysql.jdbc.PreparedStatement) con.prepareStatement(sql);
               st.setString(1, customer.getSelectedItem().toString());
                 st.setString(2, jTextField3.getText().toString());
                 st.setInt(3,q);
                st.execute();
                st.close();
                con.commit();
              //  JOptionPane.showMessageDialog(null, "saved!");

            } catch (Exception se) {
                se.printStackTrace();
            }
    }

Any ideas?

Another question, if I was to use two separate databases.

What could I use to push the data from one database to another(i.e syncronise)?

london-G Light Poster

I am developing a software which will connect to the same database as another application. Is there a term for that?

Also any tips on what sort of methods I can use?

london-G Light Poster

Hello,

I am developing a software(Java, SQL) which will connect to another's system database in order to have an inventory up to date.

I have made some reaseach on the best practices to do that but I am sort of lost. I have read about different integration level, I think in my case I am looking at data level integration. Is this referred as Entreprise Application Integration?

Any tips on what I could be searching for?

Thanks!

Thanks Shiftleft for the clear explanation! Makes sense now.

Thanks guys!

Hmm, I still don't understand. Let's say I develp an application that connects to a SQL database such as an accounting software. Will my application be considered as a DBMS?