code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
package sat; import java.util.Vector; import sat.convenience.Solution; import sat.exceptions.ParseException; public class FormulaCNF { private Vector<ClauseCNF> clauses; /** * Konwertuje formułę w postaci CNF z reprezentacji tekstowej na wewnętrzną * @param formula reprezentacja tekstowa * @throws ParseException */ public FormulaCNF(String formula) throws ParseException{ clauses = new Vector<ClauseCNF>(); parseString(formula); } /** * Zwraca zbiór literałów (bez powtórzeń) występujących w formule (zaniedbując * ew. negacje) * @return zbiór literałów wraz z przypisanymi im początkowo wartościami (wszystkie fałsz) */ public Solution getUniqueLiterals(){ Solution resultSet = new Solution(); for(int i=0; i<clauses.size(); ++i){ for(int j=0; j<clauses.get(i).getStringLiterals().size(); ++j){ resultSet.put(clauses.get(i).getStringLiterals().get(j), Boolean.FALSE); } } return resultSet; } /** * Sprawdza, czy podane rozwiązanie spełnia formułę. * @param values * @return */ public boolean evaluate(Solution values){ for(int i=0; i<clauses.size(); ++i){ if(!clauses.get(i).evaluate(values)){ return false; } } return true; } /** * Prywatna metoda realizująca parsowanie tekstu celem konwersji formuły * do reprezentacji wewnętrznej. * @param formula tekstowa postać formuły * @throws ParseException */ private void parseString(String formula) throws ParseException{ String[] tokens = formula.split("&"); for(int i=0; i<tokens.length; ++i){ clauses.add(new ClauseCNF(tokens[i])); } } public String toString(){ StringBuffer sb = new StringBuffer(); for(int i=0; i<clauses.size(); ++i){ if(i!=0){ sb.append(" & "); } sb.append(clauses.get(i).toString()); } return sb.toString(); } /** * Zwraca odsetek klauzul spełnionych danym podstawieniem * @param solution podstawienie * @return odsetek wyrażony jako liczba 0-1 */ public float getTrueClausesPercentage(Solution solution){ int t = 0; for(int i=0; i<clauses.size(); ++i){ t+=(clauses.get(i).evaluate(solution)?1:0); } return t/(float)clauses.size(); } /** * Zwraca odsetek spełnionych klauzul wyrażony jako stosunek łącznej długości * spełnionych klauzul do łącznej długości wszystkich klauzul ("odsetek ważony") * @param solution podstawienie * @return odsetek wyrażony jako liczba 0-1 */ public float getWeighedTrueClausesPercentage(Solution solution){ int t=0, s=0; for(int i=0; i<clauses.size(); ++i){ int literals = clauses.get(i).getLiteralsCount(); s+=literals; t+=(clauses.get(i).evaluate(solution)?literals:0); } return t/(float)s; } }
11z-wmh-sat
trunk/src/sat/FormulaCNF.java
Java
gpl3
3,180
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package sat.convenience; import java.util.HashMap; /** * * @author bawey */ public class Solution extends HashMap<String, Boolean> { }
11z-wmh-sat
trunk/src/sat/convenience/Solution.java
Java
gpl3
245
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package sat.convenience; import java.util.HashMap; import java.util.Vector; /** * * @author bawey */ public class VariationMaps extends Vector<VariationMap> { }
11z-wmh-sat
trunk/src/sat/convenience/VariationMaps.java
Java
gpl3
271
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package sat.convenience; import java.util.HashMap; /** * * @author bawey */ public class VariationMap extends HashMap<String,Float>{ }
11z-wmh-sat
trunk/src/sat/convenience/VariationMap.java
Java
gpl3
245
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package sat.convenience; import java.util.Vector; /** * * @author bawey */ public class Population extends Vector<Solution> { //just a damn convenience }
11z-wmh-sat
trunk/src/sat/convenience/Population.java
Java
gpl3
263
package sat; /** * @author bawey */ public class LiteralCNF { private boolean negated; private String symbol; /** * Konstruktor klasy reprezentującej literał * @param s symbol literału * @param n true, jeśli literał ma być zanegowany */ public LiteralCNF(String s, boolean n){ negated=n; symbol=s; } public String getSymbol(){ return symbol; } public boolean isNegated(){ return negated; } public String toString(){ return (negated?"~":"")+symbol; } }
11z-wmh-sat
trunk/src/sat/LiteralCNF.java
Java
gpl3
577
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package sat; import java.lang.String; import java.util.HashMap; import java.util.Iterator; import java.util.Vector; import sat.convenience.Solution; /** * Klasa zawrierająca metody pomocnicze dla algorytmu GSAT * @author bawey */ public class GsatToolkit { /** * Zwraca Vector rozwiązań stanowiących sąsiedztwo zadanego rozwiązania * @param solution rozwiązanie wyjściowe * @param distance dystans Hamminga * @return Vector podstawień */ public static Vector<Solution>getNeighborhood(Solution solution, int distance){ Vector<Solution> result = new Vector<Solution>(); if(distance!=1){ throw new UnsupportedOperationException(); }else{ result.ensureCapacity(solution.keySet().size()); int i=0; for(Iterator it=solution.keySet().iterator(); it.hasNext(); ++i){ result.add((Solution)solution.clone()); String key = (String)it.next(); result.get(i).put(key, (solution.get(key).booleanValue()?Boolean.FALSE:Boolean.TRUE)); // System.out.println(i); // System.out.println(result.get(i)); } } //System.out.println(result); return result; } /** * Inicjalizacja rozwiązania wartościami losowymi * @param solution * @return */ public static Solution randomize(Solution solution){ Solution result = new Solution(); for(Iterator i = solution.keySet().iterator(); i.hasNext(); ){ String key = (String) i.next(); result.put(key, (Math.random()>0.5?Boolean.TRUE:Boolean.FALSE)); } return result; } /** * Zwraca najlepsze rozwiązanie znalezione w otoczeniu rozwiązania candidate. * Jeśli zwraca null - algorytm utknął * @param formula formuła logiczna * @param candidate wyjściowe podstawienia * @param area zbiór rozwiązań przeszukiwanych celem znalezienia lepszego * @return najlepsze z rozpatrywanych rozwiązań */ public static Solution getBest(FormulaCNF formula, Solution candidate, Vector<Solution> area){ //System.out.println(candidate); //System.out.println(area); float initialScore = formula.getTrueClausesPercentage(candidate); //System.out.println("initial score: "+initialScore); float bestScore = Float.NEGATIVE_INFINITY; int leader = -1; for(int i=0; i<area.size(); ++i){ float score = formula.getTrueClausesPercentage(area.get(i))-initialScore; if(score>=bestScore){ bestScore=score; leader=i; } } //System.out.println("best score: "+bestScore); return bestScore>=0f?area.get(leader):null; } }
11z-wmh-sat
trunk/src/sat/GsatToolkit.java
Java
gpl3
2,941
package sat; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import sat.convenience.Population; import sat.convenience.Solution; import sat.convenience.VariationMap; import sat.convenience.VariationMaps; /** * Klasa zawiera zbiór funkcji wykorzystywanych w implementacji algorytmu evolucyjnego * @author bawey */ public class EvosatToolkit { /** * Funkcja generująca populację rozwiązań * @param size porządana liczność populacji * @param solution rozwiązanie początkowe. Wartości przypisań są ignorowane. * @return uzyskana populacja */ public static Population generatePopulation(int size, Solution solution) { Population population = new Population(); population.ensureCapacity(size); for (int i = 0; i < size; ++i) { population.add(GsatToolkit.randomize(solution)); } return population; } /** * Funkcja przeszukuje populację w nadziei znalezienia podstawienia spełniającego * formułe. * @param formula formuła logiczna * @param population populacja * @return szukane podstawienie lub null */ public static Solution evaluatePopulation(FormulaCNF formula, Population population) { for (int i = 0; i < population.size(); ++i) { if (formula.evaluate(population.get(i))) { return population.get(i); } } return null; } /** * Funkcja generuje populację pośrednią * @param formula formuła logiczna, względem której weryfikowane jest przystosowanie osobników * @param srcPopulation populacja źródłowa * @param intermediateToParentsRatio stosunek liczności populacji macierzystej * do liczności wygenerowanej populacji * @return wygenerowana populacja */ public static Population generateOffspring(FormulaCNF formula, Population srcPopulation, int intermediateToParentsRatio) { intermediateToParentsRatio=Math.max(intermediateToParentsRatio, 1); Population dstPopulation = new Population(); float values[] = new float[srcPopulation.size()]; for (int i = 0; i < srcPopulation.size(); ++i) { values[i] = formula.getTrueClausesPercentage(srcPopulation.get(i)); } float[] distribution = getDistribution(values); //fill the new population for (int i = 0; i < srcPopulation.size()*intermediateToParentsRatio; ++i) { dstPopulation.add(createOneChild(srcPopulation, distribution)); } return dstPopulation; } /** * Funkcja generuje koło ruletki dla populacji. Koło odwzorowane jest na przedział liczbowy 0-1, * a każdemu z odcinków przypisany jest jego podprzedział, proporcjonalny do wartości funkcji * przystosowania danego osobnika. I-ta wartość w zwracanej tablicy odpowiada końcowi przedziału * przydzielonemu itemu osobnikowi. Początek tego porzedziału to koniec poprzedniego lub 0 * (dla pierwszego osobnika). Koło ruletki jest wykorzystywane przy doborze rodziców. * @param values wartości funkcji przystosowania * @return krańce przedziałów przypisanych każdemu z osobników. */ private static float[] getDistribution(float[] values) { float[] result = new float[values.length]; float sum = 0f; for (float value : values) { value = (float) Math.pow(value, 10); sum += value; } //System.out.println(" avg quality: " + sum / values.length); //System.err.println("= "+sum); for (int i = 0; i < values.length; ++i) { float prev = (i == 0 ? 0f : result[i - 1]); result[i] = prev + values[i] / sum; //System.err.println(i+"th value: "+result[i]); } return result; } /** * Na podstawie koła ruletki funkcja dobiera dwa osobniki potomne i tworzy zwraca jeden potomny. * @param srcPopulation populacja źródłowa * @param distribution koło ruletki * @return potomny osobnik */ private static Solution createOneChild(Population srcPopulation, float[] distribution) { float rand1 = (float) Math.random(); float rand2 = (float) Math.random(); int i1 = -1, i2 = -1; for (int i = 0; i < distribution.length; ++i) { float prev = (i == 0 ? 0f : distribution[i - 1]); if (rand1 > prev && rand1 <= distribution[i]) { i1 = i; } if (rand2 > prev && rand2 <= distribution[i]) { i2 = i; } } if (i1 == -1) { i1 = 0; } if (i2 == -1) { i2 = 0; } //so i1 and i2 are the parents chosen for breeding. cool, huh? return crossSolutions(srcPopulation.get(i1), srcPopulation.get(i2)); } /** * Funkcja tworząca rozwiązanie na podstawie losowego krzyżowania dwóch osobników rodzicielskich. * Wartość każdego z podstawień jest losowo dziedziczona po jednym z rodziców. * @param meat1 pierwszy rodzic * @param meat2 drugi rodzic * @return potomek */ private static Solution crossSolutions(Solution meat1, Solution meat2) { Solution child = new Solution(); for (Iterator it = meat1.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); child.put(key, Math.random() > 0.5 ? meat1.get(key) : meat2.get(key)); } return child; } /** * Funkcja wprowadza mutacje poprzez losowe negowanie niektórych przypisań. * @param lambda populacja bez mutacji * @param probability prawdopodobieństwo zajścia mutacji dla każdego z przypisań. * @return populacja zawierająca tak osobniki sprzed, jak i po mutacji */ public static Population applyMutations(Population lambda, float probability) { Population mutants = new Population(); for (Iterator<Solution> it = lambda.iterator(); it.hasNext();) { Solution solution = (Solution) it.next().clone(); mutants.add((Solution)solution.clone()); boolean hasChanged=false; for (Iterator<String> sit = solution.keySet().iterator(); sit.hasNext();) { String key = sit.next(); if (Math.random() < probability) { hasChanged=true; solution.put(key, solution.get(key).booleanValue() ? Boolean.FALSE : Boolean.TRUE); } } if(hasChanged){ mutants.add(solution); } } return mutants; } /** * Funkcja wybiera najlepsze spośród osobników populacji pośredniej, by utworzyły nową populację. * @param problem formuła logiczna stanowiąca rozwiązywany problem * @param mi populacja, wewnątrz której dokonywana jest selekcja * @param offspringOnly prawda, jeśli przekazana funkcji populacja zawiera wyłącznie osobniki potomne * @param limit limit osobników, które mają utworzyć nową populację * @return wynikowa populacja */ public static Population performSelection(FormulaCNF problem, Population mi, boolean offspringOnly, int limit) { final FormulaCNF problem_copy = problem; Collections.sort(mi, new Comparator<Solution>() { @Override public int compare(Solution t, Solution t1) { if (problem_copy.getTrueClausesPercentage(t) > problem_copy.getTrueClausesPercentage(t1)) { return -1; } return 1; } }); Population selection = (Population) mi.clone(); for (int i = limit; i < selection.size(); ++i) { selection.removeElementAt(i); } return selection; } }
11z-wmh-sat
trunk/src/sat/EvosatToolkit.java
Java
gpl3
8,010
package sat; import java.util.HashMap; import java.util.Vector; import sat.exceptions.ParseException; /** * * @author bawey */ public class ClauseCNF { private Vector<LiteralCNF> literals; /** * @param representation formuła logiczna w postaci CNF * @throws ParseException */ public ClauseCNF(String representation) throws ParseException { literals = new Vector<LiteralCNF>(); parseString(representation); } /** * @return liczba literałów w klauzuli */ public int getLiteralsCount() { return literals.size(); } /** * @return Vector literałów występujących w klauzuli, pomija ew. negację */ public Vector<String> getStringLiterals() { Vector<String> temp = new Vector<String>(); for (int i = 0; i < literals.size(); ++i) { temp.add(literals.get(i).getSymbol()); } return temp; } /** * Sprawdza, czy dla danego podstawienia klauzula jest prawdziwa * @param values - podstawienia * @return */ public boolean evaluate(HashMap<String, Boolean> values) { for (int i = 0; i < literals.size(); ++i) { //what will return without entry? if ((values.get(literals.get(i).getSymbol())).booleanValue() ^ literals.get(i).isNegated()) { return true; } } return false; } /** * Funkcja prywatna, konwertuje klauzulę z postaci tekstowej do reprezentacji wewnętrznej * @param c tekst wejściowy * @throws ParseException */ private void parseString(String c) throws ParseException { c = StringToolkit.strip(c); boolean negated = false; StringBuffer literal = new StringBuffer(); for (int i = 0; i < c.length(); ++i) { if (c.charAt(i) == '~') { if (literal.length() == 0) { negated = !negated; } else { throw (new ParseException("unexpected ~")); } } else if (c.charAt(i) == '|') { if (literal.length() > 0) { literals.add(new LiteralCNF(literal.toString(), negated)); literal = new StringBuffer(); negated = false; } else { throw (new ParseException("unexpected |")); } } else { literal.append(c.charAt(i)); } } if (literal.length() > 0) { literals.add(new LiteralCNF(literal.toString(), negated)); } } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("("); for (int i = 0; i < literals.size(); ++i) { if (i != 0) { sb.append("|"); } sb.append(literals.get(i).toString()); } sb.append(")"); return sb.toString(); } }
11z-wmh-sat
trunk/src/sat/ClauseCNF.java
Java
gpl3
2,986
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp-blog-header.php' );
01-wordpress-paypal
trunk/index.php
PHP
gpl3
418
<?php /** * Handles Comment Post to WordPress and prevents duplicate comment posting. * * @package WordPress */ if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) { header('Allow: POST'); header('HTTP/1.1 405 Method Not Allowed'); header('Content-Type: text/plain'); exit; } /** Sets up the WordPress Environment. */ require( dirname(__FILE__) . '/wp-load.php' ); nocache_headers(); $comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0; $post = get_post($comment_post_ID); if ( empty( $post->comment_status ) ) { /** * Fires when a comment is attempted on a post that does not exist. * * @since 1.5.0 * * @param int $comment_post_ID Post ID. */ do_action( 'comment_id_not_found', $comment_post_ID ); exit; } // get_post_status() will get the parent status for attachments. $status = get_post_status($post); $status_obj = get_post_status_object($status); if ( ! comments_open( $comment_post_ID ) ) { /** * Fires when a comment is attempted on a post that has comments closed. * * @since 1.5.0 * * @param int $comment_post_ID Post ID. */ do_action( 'comment_closed', $comment_post_ID ); wp_die( __('Sorry, comments are closed for this item.') ); } elseif ( 'trash' == $status ) { /** * Fires when a comment is attempted on a trashed post. * * @since 2.9.0 * * @param int $comment_post_ID Post ID. */ do_action( 'comment_on_trash', $comment_post_ID ); exit; } elseif ( ! $status_obj->public && ! $status_obj->private ) { /** * Fires when a comment is attempted on a post in draft mode. * * @since 1.5.1 * * @param int $comment_post_ID Post ID. */ do_action( 'comment_on_draft', $comment_post_ID ); exit; } elseif ( post_password_required( $comment_post_ID ) ) { /** * Fires when a comment is attempted on a password-protected post. * * @since 2.9.0 * * @param int $comment_post_ID Post ID. */ do_action( 'comment_on_password_protected', $comment_post_ID ); exit; } else { /** * Fires before a comment is posted. * * @since 2.8.0 * * @param int $comment_post_ID Post ID. */ do_action( 'pre_comment_on_post', $comment_post_ID ); } $comment_author = ( isset($_POST['author']) ) ? trim(strip_tags($_POST['author'])) : null; $comment_author_email = ( isset($_POST['email']) ) ? trim($_POST['email']) : null; $comment_author_url = ( isset($_POST['url']) ) ? trim($_POST['url']) : null; $comment_content = ( isset($_POST['comment']) ) ? trim($_POST['comment']) : null; // If the user is logged in $user = wp_get_current_user(); if ( $user->exists() ) { if ( empty( $user->display_name ) ) $user->display_name=$user->user_login; $comment_author = wp_slash( $user->display_name ); $comment_author_email = wp_slash( $user->user_email ); $comment_author_url = wp_slash( $user->user_url ); if ( current_user_can( 'unfiltered_html' ) ) { if ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) || ! wp_verify_nonce( $_POST['_wp_unfiltered_html_comment'], 'unfiltered-html-comment_' . $comment_post_ID ) ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters } } } else { if ( get_option('comment_registration') || 'private' == $status ) wp_die( __('Sorry, you must be logged in to post a comment.') ); } $comment_type = ''; if ( get_option('require_name_email') && !$user->exists() ) { if ( 6 > strlen($comment_author_email) || '' == $comment_author ) wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).') ); elseif ( !is_email($comment_author_email)) wp_die( __('<strong>ERROR</strong>: please enter a valid email address.') ); } if ( '' == $comment_content ) wp_die( __('<strong>ERROR</strong>: please type a comment.') ); $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); $comment_id = wp_new_comment( $commentdata ); $comment = get_comment($comment_id); /** * Perform other actions when comment cookies are set. * * @since 3.4.0 * * @param object $comment Comment object. * @param WP_User $user User object. The user may not exist. */ do_action( 'set_comment_cookies', $comment, $user ); $location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id; /** * Filter the location URI to send the commenter after posting. * * @since 2.0.5 * * @param string $location The 'redirect_to' URI sent via $_POST. * @param object $comment Comment object. */ $location = apply_filters( 'comment_post_redirect', $location, $comment ); wp_safe_redirect( $location ); exit;
01-wordpress-paypal
trunk/wp-comments-post.php
PHP
gpl3
4,818
<?php /** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing * wp-config.php} Codex page. You can get the MySQL settings from your web host. * * This file is used by the wp-config.php creation script during the * installation. You don't have to use the web site, you can just copy this file * to "wp-config.php" and fill in the values. * * @package WordPress */ // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'p01'); /** MySQL database username */ define('DB_USER', 'root'); /** MySQL database password */ define('DB_PASSWORD', ''); /** MySQL hostname */ define('DB_HOST', 'localhost'); /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', ''); /**#@+ * Authentication Unique Keys and Salts. * * Change these to different unique phrases! * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. * * @since 2.6.0 */ define('AUTH_KEY', '(i-L+@7F:x-],7ReNRczTH&S<{4XA!nK`Arsl]=>,:]d$hB|JjX5ETEPd&tj>vLV'); define('SECURE_AUTH_KEY', '+H/I]c$~BfJ7MAz*/j+y`Bmm35$H]ov]mk+7I*iI-Ep}PrHX|8D(wd-EY+q?$ Ie'); define('LOGGED_IN_KEY', 'j7mXY:DJR(@Ql^5)sh)R`n_;Ljnj*8+Pn,W]9PjjjUxO&~p&@|0=v+4q?4$>3wD-'); define('NONCE_KEY', 'c tAkNpSfP3BnL!3AU/3<0V{A&MeW%r-$$H%.BQ3zW96gU`K?]l}n0k r<Nt5!d'); define('AUTH_SALT', ')dd0.-dEyL/x5z?x||6G-a|epnL^af:k%dsAM4#%LB`?RxT{z2~{<6fViF}I|%Li'); define('SECURE_AUTH_SALT', '_i0gYRo%z=FPDAu*l%DxC|(b8Fw6V3bq9[uG]!0{ZQk]iLiYA#K@pmhB7!mM|VhL'); define('LOGGED_IN_SALT', 'QSJ^..1+i+B;Z[>M$B!4CUc7[-iC-wf61uM%7KGUz+e!yq(=hB+UK:${~GP/~0F|'); define('NONCE_SALT', '%=-P8XF)|$LIYt<iEbx]<fm5M,w`Yp1CA&vxE*zI_gH5L:>|IVO_ylm;6bY,-dk/'); /**#@-*/ /** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each a unique * prefix. Only numbers, letters, and underscores please! */ $table_prefix = 'wp_'; /** * WordPress Localized Language, defaults to English. * * Change this to localize WordPress. A corresponding MO file for the chosen * language must be installed to wp-content/languages. For example, install * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German * language support. */ define('WPLANG', ''); /** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. */ define('WP_DEBUG', false); /* That's all, stop editing! Happy blogging. */ /** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php');
01-wordpress-paypal
trunk/wp-config.php
PHP
gpl3
3,359
<?php /** * Used to set up and fix common variables and include * the WordPress procedural and class library. * * Allows for some configuration in wp-config.php (see default-constants.php) * * @internal This file must be parsable by PHP4. * * @package WordPress */ /** * Stores the location of the WordPress directory of functions, classes, and core content. * * @since 1.0.0 */ define( 'WPINC', 'wp-includes' ); // Include files required for initialization. require( ABSPATH . WPINC . '/load.php' ); require( ABSPATH . WPINC . '/default-constants.php' ); /* * These can't be directly globalized in version.php. When updating, * we're including version.php from another install and don't want * these values to be overridden if already set. */ global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version; require( ABSPATH . WPINC . '/version.php' ); // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. wp_initial_constants(); // Check for the required PHP version and for the MySQL extension or a database drop-in. wp_check_php_mysql_versions(); // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. @ini_set( 'magic_quotes_runtime', 0 ); @ini_set( 'magic_quotes_sybase', 0 ); // WordPress calculates offsets from UTC. date_default_timezone_set( 'UTC' ); // Turn register_globals off. wp_unregister_GLOBALS(); // Standardize $_SERVER variables across setups. wp_fix_server_vars(); // Check if we have received a request due to missing favicon.ico wp_favicon_request(); // Check if we're in maintenance mode. wp_maintenance(); // Start loading timer. timer_start(); // Check if we're in WP_DEBUG mode. wp_debug_mode(); // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. if ( WP_CACHE ) WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); // Define WP_LANG_DIR if not set. wp_set_lang_dir(); // Load early WordPress files. require( ABSPATH . WPINC . '/compat.php' ); require( ABSPATH . WPINC . '/functions.php' ); require( ABSPATH . WPINC . '/class-wp.php' ); require( ABSPATH . WPINC . '/class-wp-error.php' ); require( ABSPATH . WPINC . '/plugin.php' ); require( ABSPATH . WPINC . '/pomo/mo.php' ); // Include the wpdb class and, if present, a db.php database drop-in. require_wp_db(); // Set the database table prefix and the format specifiers for database table columns. $GLOBALS['table_prefix'] = $table_prefix; wp_set_wpdb_vars(); // Start the WordPress object cache, or an external object cache if the drop-in is present. wp_start_object_cache(); // Attach the default filters. require( ABSPATH . WPINC . '/default-filters.php' ); // Initialize multisite if enabled. if ( is_multisite() ) { require( ABSPATH . WPINC . '/ms-blogs.php' ); require( ABSPATH . WPINC . '/ms-settings.php' ); } elseif ( ! defined( 'MULTISITE' ) ) { define( 'MULTISITE', false ); } register_shutdown_function( 'shutdown_action_hook' ); // Stop most of WordPress from being loaded if we just want the basics. if ( SHORTINIT ) return false; // Load the L10n library. require_once( ABSPATH . WPINC . '/l10n.php' ); // Run the installer if WordPress is not installed. wp_not_installed(); // Load most of WordPress. require( ABSPATH . WPINC . '/class-wp-walker.php' ); require( ABSPATH . WPINC . '/class-wp-ajax-response.php' ); require( ABSPATH . WPINC . '/formatting.php' ); require( ABSPATH . WPINC . '/capabilities.php' ); require( ABSPATH . WPINC . '/query.php' ); require( ABSPATH . WPINC . '/date.php' ); require( ABSPATH . WPINC . '/theme.php' ); require( ABSPATH . WPINC . '/class-wp-theme.php' ); require( ABSPATH . WPINC . '/template.php' ); require( ABSPATH . WPINC . '/user.php' ); require( ABSPATH . WPINC . '/meta.php' ); require( ABSPATH . WPINC . '/general-template.php' ); require( ABSPATH . WPINC . '/link-template.php' ); require( ABSPATH . WPINC . '/author-template.php' ); require( ABSPATH . WPINC . '/post.php' ); require( ABSPATH . WPINC . '/post-template.php' ); require( ABSPATH . WPINC . '/revision.php' ); require( ABSPATH . WPINC . '/post-formats.php' ); require( ABSPATH . WPINC . '/post-thumbnail-template.php' ); require( ABSPATH . WPINC . '/category.php' ); require( ABSPATH . WPINC . '/category-template.php' ); require( ABSPATH . WPINC . '/comment.php' ); require( ABSPATH . WPINC . '/comment-template.php' ); require( ABSPATH . WPINC . '/rewrite.php' ); require( ABSPATH . WPINC . '/feed.php' ); require( ABSPATH . WPINC . '/bookmark.php' ); require( ABSPATH . WPINC . '/bookmark-template.php' ); require( ABSPATH . WPINC . '/kses.php' ); require( ABSPATH . WPINC . '/cron.php' ); require( ABSPATH . WPINC . '/deprecated.php' ); require( ABSPATH . WPINC . '/script-loader.php' ); require( ABSPATH . WPINC . '/taxonomy.php' ); require( ABSPATH . WPINC . '/update.php' ); require( ABSPATH . WPINC . '/canonical.php' ); require( ABSPATH . WPINC . '/shortcodes.php' ); require( ABSPATH . WPINC . '/class-wp-embed.php' ); require( ABSPATH . WPINC . '/media.php' ); require( ABSPATH . WPINC . '/http.php' ); require( ABSPATH . WPINC . '/class-http.php' ); require( ABSPATH . WPINC . '/widgets.php' ); require( ABSPATH . WPINC . '/nav-menu.php' ); require( ABSPATH . WPINC . '/nav-menu-template.php' ); require( ABSPATH . WPINC . '/admin-bar.php' ); // Load multisite-specific files. if ( is_multisite() ) { require( ABSPATH . WPINC . '/ms-functions.php' ); require( ABSPATH . WPINC . '/ms-default-filters.php' ); require( ABSPATH . WPINC . '/ms-deprecated.php' ); } // Define constants that rely on the API to obtain the default value. // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. wp_plugin_directory_constants(); $GLOBALS['wp_plugin_paths'] = array(); // Load must-use plugins. foreach ( wp_get_mu_plugins() as $mu_plugin ) { include_once( $mu_plugin ); } unset( $mu_plugin ); // Load network activated plugins. if ( is_multisite() ) { foreach( wp_get_active_network_plugins() as $network_plugin ) { wp_register_plugin_realpath( $network_plugin ); include_once( $network_plugin ); } unset( $network_plugin ); } /** * Fires once all must-use and network-activated plugins have loaded. * * @since 2.8.0 */ do_action( 'muplugins_loaded' ); if ( is_multisite() ) ms_cookie_constants( ); // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). wp_cookie_constants(); // Define and enforce our SSL constants wp_ssl_constants(); // Create common globals. require( ABSPATH . WPINC . '/vars.php' ); // Make taxonomies and posts available to plugins and themes. // @plugin authors: warning: these get registered again on the init hook. create_initial_taxonomies(); create_initial_post_types(); // Register the default theme directory root register_theme_directory( get_theme_root() ); // Load active plugins. foreach ( wp_get_active_and_valid_plugins() as $plugin ) { wp_register_plugin_realpath( $plugin ); include_once( $plugin ); } unset( $plugin ); // Load pluggable functions. require( ABSPATH . WPINC . '/pluggable.php' ); require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); // Set internal encoding. wp_set_internal_encoding(); // Run wp_cache_postload() if object cache is enabled and the function exists. if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) wp_cache_postload(); /** * Fires once activated plugins have loaded. * * Pluggable functions are also available at this point in the loading order. * * @since 1.5.0 */ do_action( 'plugins_loaded' ); // Define constants which affect functionality if not already defined. wp_functionality_constants(); // Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) wp_magic_quotes(); /** * Fires when comment cookies are sanitized. * * @since 2.0.11 */ do_action( 'sanitize_comment_cookies' ); /** * WordPress Query object * @global object $wp_the_query * @since 2.0.0 */ $GLOBALS['wp_the_query'] = new WP_Query(); /** * Holds the reference to @see $wp_the_query * Use this global for WordPress queries * @global object $wp_query * @since 1.5.0 */ $GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; /** * Holds the WordPress Rewrite object for creating pretty URLs * @global object $wp_rewrite * @since 1.5.0 */ $GLOBALS['wp_rewrite'] = new WP_Rewrite(); /** * WordPress Object * @global object $wp * @since 2.0.0 */ $GLOBALS['wp'] = new WP(); /** * WordPress Widget Factory Object * @global object $wp_widget_factory * @since 2.8.0 */ $GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); /** * WordPress User Roles * @global object $wp_roles * @since 2.0.0 */ $GLOBALS['wp_roles'] = new WP_Roles(); /** * Fires before the theme is loaded. * * @since 2.6.0 */ do_action( 'setup_theme' ); // Define the template related constants. wp_templating_constants( ); // Load the default text localization domain. load_default_textdomain(); $locale = get_locale(); $locale_file = WP_LANG_DIR . "/$locale.php"; if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) require( $locale_file ); unset( $locale_file ); // Pull in locale data after loading text domain. require_once( ABSPATH . WPINC . '/locale.php' ); /** * WordPress Locale object for loading locale domain date and various strings. * @global object $wp_locale * @since 2.1.0 */ $GLOBALS['wp_locale'] = new WP_Locale(); // Load the functions for the active theme, for both parent and child theme if applicable. if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) include( STYLESHEETPATH . '/functions.php' ); if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) include( TEMPLATEPATH . '/functions.php' ); } /** * Fires after the theme is loaded. * * @since 3.0.0 */ do_action( 'after_setup_theme' ); // Set up current user. $GLOBALS['wp']->init(); /** * Fires after WordPress has finished loading but before any headers are sent. * * Most of WP is loaded at this stage, and the user is authenticated. WP continues * to load on the init hook that follows (e.g. widgets), and many plugins instantiate * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). * * If you wish to plug an action once WP is loaded, use the wp_loaded hook below. * * @since 1.5.0 */ do_action( 'init' ); // Check site status if ( is_multisite() ) { if ( true !== ( $file = ms_site_check() ) ) { require( $file ); die(); } unset($file); } /** * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. * * AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for * users not logged in. * * @link http://codex.wordpress.org/AJAX_in_Plugins * * @since 3.0.0 */ do_action( 'wp_loaded' );
01-wordpress-paypal
trunk/wp-settings.php
PHP
gpl3
11,070
<?php /** * Loads the WordPress environment and template. * * @package WordPress */ if ( !isset($wp_did_header) ) { $wp_did_header = true; require_once( dirname(__FILE__) . '/wp-load.php' ); wp(); require_once( ABSPATH . WPINC . '/template-loader.php' ); }
01-wordpress-paypal
trunk/wp-blog-header.php
PHP
gpl3
271
<?php /** * Handle Trackbacks and Pingbacks Sent to WordPress * * @since 0.71 * * @package WordPress * @subpackage Trackbacks */ if (empty($wp)) { require_once( dirname( __FILE__ ) . '/wp-load.php' ); wp( array( 'tb' => '1' ) ); } /** * Response to a trackback. * * Responds with an error or success XML message. * * @since 0.71 * * @param int|bool $error Whether there was an error. * Default '0'. Accepts '0' or '1'. * @param string $error_message Error message if an error occurred. */ function trackback_response($error = 0, $error_message = '') { header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); if ($error) { echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; echo "<response>\n"; echo "<error>1</error>\n"; echo "<message>$error_message</message>\n"; echo "</response>"; die(); } else { echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; echo "<response>\n"; echo "<error>0</error>\n"; echo "</response>"; } } // Trackback is done by a POST. $request_array = 'HTTP_POST_VARS'; if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ) { $tb_id = explode('/', $_SERVER['REQUEST_URI']); $tb_id = intval( $tb_id[ count($tb_id) - 1 ] ); } $tb_url = isset($_POST['url']) ? $_POST['url'] : ''; $charset = isset($_POST['charset']) ? $_POST['charset'] : ''; // These three are stripslashed here so they can be properly escaped after mb_convert_encoding(). $title = isset($_POST['title']) ? wp_unslash($_POST['title']) : ''; $excerpt = isset($_POST['excerpt']) ? wp_unslash($_POST['excerpt']) : ''; $blog_name = isset($_POST['blog_name']) ? wp_unslash($_POST['blog_name']) : ''; if ($charset) $charset = str_replace( array(',', ' '), '', strtoupper( trim($charset) ) ); else $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; // No valid uses for UTF-7. if ( false !== strpos($charset, 'UTF-7') ) die; // For international trackbacks. if ( function_exists('mb_convert_encoding') ) { $title = mb_convert_encoding($title, get_option('blog_charset'), $charset); $excerpt = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset); $blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset); } // Now that mb_convert_encoding() has been given a swing, we need to escape these three. $title = wp_slash($title); $excerpt = wp_slash($excerpt); $blog_name = wp_slash($blog_name); if ( is_single() || is_page() ) $tb_id = $posts[0]->ID; if ( !isset($tb_id) || !intval( $tb_id ) ) trackback_response(1, 'I really need an ID for this to work.'); if (empty($title) && empty($tb_url) && empty($blog_name)) { // If it doesn't look like a trackback at all. wp_redirect(get_permalink($tb_id)); exit; } if ( !empty($tb_url) && !empty($title) ) { header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); if ( !pings_open($tb_id) ) trackback_response(1, 'Sorry, trackbacks are closed for this item.'); $title = wp_html_excerpt( $title, 250, '&#8230;' ); $excerpt = wp_html_excerpt( $excerpt, 252, '&#8230;' ); $comment_post_ID = (int) $tb_id; $comment_author = $blog_name; $comment_author_email = ''; $comment_author_url = $tb_url; $comment_content = "<strong>$title</strong>\n\n$excerpt"; $comment_type = 'trackback'; $dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) ); if ( $dupe ) trackback_response(1, 'We already have a ping from that URL for this post.'); $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type'); wp_new_comment($commentdata); $trackback_id = $wpdb->insert_id; /** * Fires after a trackback is added to a post. * * @since 1.2.0 * * @param int $trackback_id Trackback ID. */ do_action( 'trackback_post', $trackback_id ); trackback_response( 0 ); }
01-wordpress-paypal
trunk/wp-trackback.php
PHP
gpl3
4,026
<?php /** * WordPress Cron Implementation for hosts, which do not offer CRON or for which * the user has not set up a CRON job pointing to this file. * * The HTTP request to this file will not slow down the visitor who happens to * visit when the cron job is needed to run. * * @package WordPress */ ignore_user_abort(true); if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') ) die(); /** * Tell WordPress we are doing the CRON task. * * @var bool */ define('DOING_CRON', true); if ( !defined('ABSPATH') ) { /** Set up WordPress environment */ require_once( dirname( __FILE__ ) . '/wp-load.php' ); } // Uncached doing_cron transient fetch function _get_cron_lock() { global $wpdb; $value = 0; if ( wp_using_ext_object_cache() ) { // Skip local cache and force refetch of doing_cron transient in case // another processs updated the cache $value = wp_cache_get( 'doing_cron', 'transient', true ); } else { $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) ); if ( is_object( $row ) ) $value = $row->option_value; } return $value; } if ( false === $crons = _get_cron_array() ) die(); $keys = array_keys( $crons ); $gmt_time = microtime( true ); if ( isset($keys[0]) && $keys[0] > $gmt_time ) die(); $doing_cron_transient = get_transient( 'doing_cron'); // Use global $doing_wp_cron lock otherwise use the GET lock. If no lock, trying grabbing a new lock. if ( empty( $doing_wp_cron ) ) { if ( empty( $_GET[ 'doing_wp_cron' ] ) ) { // Called from external script/job. Try setting a lock. if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) return; $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); set_transient( 'doing_cron', $doing_wp_cron ); } else { $doing_wp_cron = $_GET[ 'doing_wp_cron' ]; } } // Check lock if ( $doing_cron_transient != $doing_wp_cron ) return; foreach ( $crons as $timestamp => $cronhooks ) { if ( $timestamp > $gmt_time ) break; foreach ( $cronhooks as $hook => $keys ) { foreach ( $keys as $k => $v ) { $schedule = $v['schedule']; if ( $schedule != false ) { $new_args = array($timestamp, $schedule, $hook, $v['args']); call_user_func_array('wp_reschedule_event', $new_args); } wp_unschedule_event( $timestamp, $hook, $v['args'] ); /** * Fires scheduled events. * * @since 2.1.0 * * @param string $hook Name of the hook that was scheduled to be fired. * @param array $v['args'] The arguments to be passed to the hook. */ do_action_ref_array( $hook, $v['args'] ); // If the hook ran too long and another cron process stole the lock, quit. if ( _get_cron_lock() != $doing_wp_cron ) return; } } } if ( _get_cron_lock() == $doing_wp_cron ) delete_transient( 'doing_cron' ); die();
01-wordpress-paypal
trunk/wp-cron.php
PHP
gpl3
2,932
<?php /** * Confirms that the activation key that is sent in an email after a user signs * up for a new blog matches the key for that user and then displays confirmation. * * @package WordPress */ define( 'WP_INSTALLING', true ); /** Sets up the WordPress Environment. */ require( dirname(__FILE__) . '/wp-load.php' ); require( dirname( __FILE__ ) . '/wp-blog-header.php' ); if ( !is_multisite() ) { wp_redirect( site_url( '/wp-login.php?action=register' ) ); die(); } if ( is_object( $wp_object_cache ) ) $wp_object_cache->cache_enabled = false; // Fix for page title $wp_query->is_404 = false; /** * Fires before the Site Activation page is loaded. * * @since 3.0.0 */ do_action( 'activate_header' ); /** * Adds an action hook specific to this page that fires on wp_head * * @since MU */ function do_activate_header() { /** * Fires before the Site Activation page is loaded, but on the wp_head action. * * @since 3.0.0 */ do_action( 'activate_wp_head' ); } add_action( 'wp_head', 'do_activate_header' ); /** * Loads styles specific to this page. * * @since MU */ function wpmu_activate_stylesheet() { ?> <style type="text/css"> form { margin-top: 2em; } #submit, #key { width: 90%; font-size: 24px; } #language { margin-top: .5em; } .error { background: #f66; } span.h3 { padding: 0 8px; font-size: 1.3em; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; font-weight: bold; color: #333; } </style> <?php } add_action( 'wp_head', 'wpmu_activate_stylesheet' ); get_header(); ?> <div id="content" class="widecolumn"> <?php if ( empty($_GET['key']) && empty($_POST['key']) ) { ?> <h2><?php _e('Activation Key Required') ?></h2> <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url('wp-activate.php'); ?>"> <p> <label for="key"><?php _e('Activation Key:') ?></label> <br /><input type="text" name="key" id="key" value="" size="50" /> </p> <p class="submit"> <input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e('Activate') ?>" /> </p> </form> <?php } else { $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key']; $result = wpmu_activate_signup($key); if ( is_wp_error($result) ) { if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) { $signup = $result->get_error_data(); ?> <h2><?php _e('Your account is now active!'); ?></h2> <?php echo '<p class="lead-in">'; if ( $signup->domain . $signup->path == '' ) { printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() ); } else { printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url() ); } echo '</p>'; } else { ?> <h2><?php _e('An error occurred during the activation'); ?></h2> <?php echo '<p>'.$result->get_error_message().'</p>'; } } else { extract($result); $url = get_blogaddress_by_id( (int) $blog_id); $user = get_userdata( (int) $user_id); ?> <h2><?php _e('Your account is now active!'); ?></h2> <div id="signup-welcome"> <p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p> <p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $password; ?></p> </div> <?php if ( $url != network_home_url('', 'http') ) : ?> <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, $url . 'wp-login.php' ); ?></p> <?php else: ?> <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url('wp-login.php', 'login'), network_home_url() ); ?></p> <?php endif; } } ?> </div> <script type="text/javascript"> var key_input = document.getElementById('key'); key_input && key_input.focus(); </script> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-activate.php
PHP
gpl3
4,896
<?php /* ******************************************************************************* * DESCRIPTION: * * This file provides a neat and simple method to interface with paypal and * The paypal Instant Payment Notification (IPN) interface. This file is * NOT intended to make the paypal integration "plug 'n' play". It still * requires the developer (that should be you) to understand the paypal * process and know the variables you want/need to pass to paypal to * achieve what you want. * * This class handles the submission of an order to paypal aswell as the * processing an Instant Payment Notification. * * This code is based on that of the php-toolkit from paypal. I've taken * the basic principals and put it in to a class so that it is a little * easier--at least for me--to use. The php-toolkit can be downloaded from * http://sourceforge.net/projects/paypal. * * To submit an order to paypal, have your order form POST to a file with: * * $p = new paypal_class; * $p->add_field('business', 'somebody@domain.com'); * $p->add_field('first_name', $_POST['first_name']); * ... (add all your fields in the same manor) * $p->submit_paypal_post(); * * To process an IPN, have your IPN processing file contain: * * $p = new paypal_class; * if ($p->validate_ipn()) { * ... (IPN is verified. Details are in the ipn_data() array) * } * * * In case you are new to paypal, here is some information to help you: * * 1. Download and read the Merchant User Manual and Integration Guide from * http://www.paypal.com/en_US/pdf/integration_guide.pdf. This gives * you all the information you need including the fields you can pass to * paypal (using add_field() with this class) aswell as all the fields * that are returned in an IPN post (stored in the ipn_data() array in * this class). It also diagrams the entire transaction process. * * 2. Create a "sandbox" account for a buyer and a seller. This is just * a test account(s) that allow you to test your site from both the * seller and buyer perspective. The instructions for this is available * at https://developer.paypal.com/ as well as a great forum where you * can ask all your paypal integration questions. Make sure you follow * all the directions in setting up a sandbox test environment, including * the addition of fake bank accounts and credit cards. * ******************************************************************************* */ class paypal_class { var $last_error; // holds the last error encountered var $ipn_log; // bool: log IPN results to text file? var $ipn_log_file; // filename of the IPN log var $ipn_response; // holds the IPN response from paypal var $ipn_data = array(); // array contains the POST values for IPN var $fields = array(); // array holds the fields to submit to paypal function paypal_class() { // initialization constructor. Called when class is created. $this->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; $this->last_error = ''; $this->ipn_log_file = '.ipn_results.log'; $this->ipn_log = true; $this->ipn_response = ''; // populate $fields array with a few default values. See the paypal // documentation for a list of fields and their data types. These defaul // values can be overwritten by the calling script. $this->add_field('rm','2'); // Return method = POST $this->add_field('cmd','_xclick'); } function add_field($field, $value) { // adds a key=>value pair to the fields array, which is what will be // sent to paypal as POST variables. If the value is already in the // array, it will be overwritten. $this->fields["$field"] = $value; } function submit_paypal_post() { // this function actually generates an entire HTML page consisting of // a form with hidden elements which is submitted to paypal via the // BODY element's onLoad attribute. We do this so that you can validate // any POST vars from you custom form before submitting to paypal. So // basically, you'll have your own form which is submitted to your script // to validate the data, which in turn calls this function to create // another hidden form and submit to paypal. // The user will briefly see a message on the screen that reads: // "Please wait, your order is being processed..." and then immediately // is redirected to paypal. echo "<html>\n"; echo "<head><title>Processing Payment...</title></head>\n"; echo "<body onLoad=\"document.forms['paypal_form'].submit();\">\n"; echo "<center><h2>Please wait, your order is being processed and you"; echo " will be redirected to the paypal website.</h2></center>\n"; echo "<form method=\"post\" name=\"paypal_form\" "; echo "action=\"".$this->paypal_url."\">\n"; foreach ($this->fields as $name => $value) { echo "<input type=\"hidden\" name=\"$name\" value=\"$value\"/>\n"; } echo "<center><br/><br/>If you are not automatically redirected to "; echo "paypal within 5 seconds...<br/><br/>\n"; echo "<input type=\"submit\" value=\"Click Here\"></center>\n"; echo "</form>\n"; echo "</body></html>\n"; } function validate_ipn() { // parse the paypal URL $url_parsed=parse_url($this->paypal_url); // generate the post string from the _POST vars aswell as load the // _POST vars into an arry so we can play with them from the calling // script. $post_string = ''; foreach ($_POST as $field=>$value) { $this->ipn_data["$field"] = $value; $post_string .= $field.'='.urlencode(stripslashes($value)).'&'; } $post_string.="cmd=_notify-validate"; // append ipn command // open the connection to paypal $fp = fsockopen($url_parsed[host],"80",$err_num,$err_str,30); if(!$fp) { // could not open the connection. If loggin is on, the error message // will be in the log. $this->last_error = "fsockopen error no. $errnum: $errstr"; $this->log_ipn_results(false); return false; } else { // Post the data back to paypal fputs($fp, "POST $url_parsed[path] HTTP/1.1\r\n"); fputs($fp, "Host: $url_parsed[host]\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-length: ".strlen($post_string)."\r\n"); fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, $post_string . "\r\n\r\n"); // loop through the response from the server and append to variable while(!feof($fp)) { $this->ipn_response .= fgets($fp, 1024); } fclose($fp); // close connection } if (eregi("VERIFIED",$this->ipn_response)) { // Valid IPN transaction. $this->log_ipn_results(true); return true; } else { // Invalid IPN transaction. Check the log for details. $this->last_error = 'IPN Validation Failed.'; $this->log_ipn_results(false); return false; } } function log_ipn_results($success) { if (!$this->ipn_log) return; // is logging turned off? // Timestamp $text = '['.date('m/d/Y g:i A').'] - '; // Success or failure being logged? if ($success) $text .= "SUCCESS!\n"; else $text .= 'FAIL: '.$this->last_error."\n"; // Log the POST variables $text .= "IPN POST Vars from Paypal:\n"; foreach ($this->ipn_data as $key=>$value) { $text .= "$key=$value, "; } // Log the response from the paypal server $text .= "\nIPN Response from Paypal Server:\n ".$this->ipn_response; // Write to log $fp=fopen($this->ipn_log_file,'a'); fwrite($fp, $text . "\n\n"); fclose($fp); // close file } function dump_fields() { // Used for debugging, this function will output all the field/value pairs // that are currently defined in the instance of the class using the // add_field() function. echo "<h3>paypal_class->dump_fields() Output:</h3>"; echo "<table width=\"95%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\"> <tr> <td bgcolor=\"black\"><b><font color=\"white\">Field Name</font></b></td> <td bgcolor=\"black\"><b><font color=\"white\">Value</font></b></td> </tr>"; ksort($this->fields); foreach ($this->fields as $key => $value) { echo "<tr><td>$key</td><td>".urldecode($value)."&nbsp;</td></tr>"; } echo "</table><br>"; } }
01-wordpress-paypal
trunk/paypal/paypal.class.php
PHP
gpl3
9,349
<?php /* PHP Paypal IPN Integration Class Demonstration File * * This file demonstrates the usage of paypal.class.php, a class designed * to aid in the interfacing between your website, paypal, and the instant * payment notification (IPN) interface. This single file serves as 4 * virtual pages depending on the "action" varialble passed in the URL. It's * the processing page which processes form data being submitted to paypal, it * is the page paypal returns a user to upon success, it's the page paypal * returns a user to upon canceling an order, and finally, it's the page that * handles the IPN request from Paypal. * * I tried to comment this file, aswell as the acutall class file, as well as * I possibly could. Please email me with questions, comments, and suggestions. * See the header of paypal.class.php for additional resources and information. */ $username = urldecode($_POST['us']); $password = urldecode($_POST['pw']); $user_mess = urldecode($_POST['usmess']); $admin_mess = urldecode($_POST['admess']); $admin_email = urldecode($_POST['admail']); $user_email = urldecode($_POST['usmail']); $site_title = urldecode($_POST['site_title']); echo $username . ' - ' . $password . '<br/>'; echo $user_mess. '<br/>'; echo $admin_mess. '<br/>'; echo $user_email. '<br/>'; echo $admin_email. '<br/>'; // Setup class require_once('paypal.class.php'); // include the class file $p = new paypal_class; // initiate an instance of the class $p->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // testing paypal url //$p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url // setup a variable for this script (ie: 'http://www.micahcarrick.com/paypal.php') $this_script = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; // if there is not action variable, set the default action of 'process' if (empty($_GET['action'])) $_GET['action'] = 'process'; switch ($_GET['action']) { case 'process': // Process and order... // There should be no output at this point. To process the POST data, // the submit_paypal_post() function will output all the HTML tags which // contains a FORM which is submited instantaneously using the BODY onload // attribute. In other words, don't echo or printf anything when you're // going to be calling the submit_paypal_post() function. // This is where you would have your form validation and all that jazz. // You would take your POST vars and load them into the class like below, // only using the POST values instead of constant string expressions. // For example, after ensureing all the POST variables from your custom // order form are valid, you might have: // // $p->add_field('first_name', $_POST['first_name']); // $p->add_field('last_name', $_POST['last_name']); $p->add_field('business', 'vinh_thien0301sandbox@yahoo.com'); $p->add_field('return', $this_script . '?action=success'); $p->add_field('cancel_return', $this_script . '?action=cancel'); $p->add_field('notify_url', $this_script . '?action=ipn'); $p->add_field('item_name', 'Paypal Test Transaction'); $p->add_field('amount', '1.99'); $p->submit_paypal_post(); // submit the fields to paypal //$p->dump_fields(); // for debugging, output a table of all the fields break; case 'success': // Order was successful... // This is where you would probably want to thank the user for their order // or what have you. The order information at this point is in POST // variables. However, you don't want to "process" the order until you // get validation from the IPN. That's where you would have the code to // email an admin, update the database with payment status, activate a // membership, etc. echo "<html><head><title>Success</title></head><body><h3>Thank you for your order.</h3>"; foreach ($_POST as $key => $value) { echo "$key: $value<br>"; } echo "</body></html>"; // You could also simply re-direct them to another page, or your own // order status page which presents the user with the status of their // order based on a database (which can be modified with the IPN code // below). break; case 'cancel': // Order was canceled... // The order was canceled before being completed. echo "<html><head><title>Canceled</title></head><body><h3>The order was canceled.</h3>"; echo "</body></html>"; break; case 'ipn': // Paypal is calling page for IPN validation... // It's important to remember that paypal calling this script. There // is no output here. This is where you validate the IPN data and if it's // valid, update your database to signify that the user has payed. If // you try and use an echo or printf function here it's not going to do you // a bit of good. This is on the "backend". That is why, by default, the // class logs all IPN data to a text file. // The message mail($admin_email, 'Trong New user registration on your site' . $site_title, $admin_mess); mail($user_email, 'Trong Registration Completed! Your Login Information For ' . $site_title, $user_mess); if ($p->validate_ipn()) { // Payment has been recieved and IPN is verified. This is where you // update your database to activate or process the order, or setup // the database with the user's order details, email an administrator, // etc. You can access a slew of information via the ipn_data() array. // Check the paypal documentation for specifics on what information // is available in the IPN POST variables. Basically, all the POST vars // which paypal sends, which we send back for validation, are now stored // in the ipn_data() array. // For this example, we'll just email ourselves ALL the data. } break; } ?>
01-wordpress-paypal
trunk/paypal/paypal.php
PHP
gpl3
6,241
<?php /** * PHPMailer - PHP email creation and transport class. * PHP Version 5.0.0 * Version 5.2.7 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ * @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2013 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ if (version_compare(PHP_VERSION, '5.0.0', '<')) { exit("Sorry, PHPMailer will only run on PHP version 5 or greater!\n"); } /** * PHPMailer - PHP email creation and transport class. * PHP Version 5.0.0 * @package PHPMailer * @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2013 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost */ class PHPMailer { /** * The PHPMailer Version number. * @type string */ public $Version = '5.2.7'; /** * Email priority. * Options: 1 = High, 3 = Normal, 5 = low. * @type int */ public $Priority = 3; /** * The character set of the message. * @type string */ public $CharSet = 'iso-8859-1'; /** * The MIME Content-type of the message. * @type string */ public $ContentType = 'text/plain'; /** * The message encoding. * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". * @type string */ public $Encoding = '8bit'; /** * Holds the most recent mailer error message. * @type string */ public $ErrorInfo = ''; /** * The From email address for the message. * @type string */ public $From = 'root@localhost'; /** * The From name of the message. * @type string */ public $FromName = 'Root User'; /** * The Sender email (Return-Path) of the message. * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. * @type string */ public $Sender = ''; /** * The Return-Path of the message. * If empty, it will be set to either From or Sender. * @type string */ public $ReturnPath = ''; /** * The Subject of the message. * @type string */ public $Subject = ''; /** * An HTML or plain text message body. * If HTML then call isHTML(true). * @type string */ public $Body = ''; /** * The plain-text message body. * This body can be read by mail clients that do not have HTML email * capability such as mutt & Eudora. * Clients that can read HTML will view the normal Body. * @type string */ public $AltBody = ''; /** * An iCal message part body. * Only supported in simple alt or alt_inline message types * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ * @link http://kigkonsult.se/iCalcreator/ * @type string */ public $Ical = ''; /** * The complete compiled MIME message body. * @access protected * @type string */ protected $MIMEBody = ''; /** * The complete compiled MIME message headers. * @type string * @access protected */ protected $MIMEHeader = ''; /** * Extra headers that createHeader() doesn't fold in. * @type string * @access protected */ protected $mailHeader = ''; /** * Word-wrap the message body to this number of chars. * @type int */ public $WordWrap = 0; /** * Which method to use to send mail. * Options: "mail", "sendmail", or "smtp". * @type string */ public $Mailer = 'mail'; /** * The path to the sendmail program. * @type string */ public $Sendmail = '/usr/sbin/sendmail'; /** * Whether mail() uses a fully sendmail-compatible MTA. * One which supports sendmail's "-oi -f" options. * @type bool */ public $UseSendmailOptions = true; /** * Path to PHPMailer plugins. * Useful if the SMTP class is not in the PHP include path. * @type string * @deprecated Should not be needed now there is an autoloader. */ public $PluginDir = ''; /** * The email address that a reading confirmation should be sent to. * @type string */ public $ConfirmReadingTo = ''; /** * The hostname to use in Message-Id and Received headers * and as default HELO string. * If empty, the value returned * by SERVER_NAME is used or 'localhost.localdomain'. * @type string */ public $Hostname = ''; /** * An ID to be used in the Message-Id header. * If empty, a unique id will be generated. * @type string */ public $MessageID = ''; /** * The message Date to be used in the Date header. * If empty, the current date will be added. * @type string */ public $MessageDate = ''; /** * SMTP hosts. * Either a single hostname or multiple semicolon-delimited hostnames. * You can also specify a different port * for each host by using this format: [hostname:port] * (e.g. "smtp1.example.com:25;smtp2.example.com"). * Hosts will be tried in order. * @type string */ public $Host = 'localhost'; /** * The default SMTP server port. * @type int * @Todo Why is this needed when the SMTP class takes care of it? */ public $Port = 25; /** * The SMTP HELO of the message. * Default is $Hostname. * @type string * @see PHPMailer::$Hostname */ public $Helo = ''; /** * The secure connection prefix. * Options: "", "ssl" or "tls" * @type string */ public $SMTPSecure = ''; /** * Whether to use SMTP authentication. * Uses the Username and Password properties. * @type bool * @see PHPMailer::$Username * @see PHPMailer::$Password */ public $SMTPAuth = false; /** * SMTP username. * @type string */ public $Username = ''; /** * SMTP password. * @type string */ public $Password = ''; /** * SMTP auth type. * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5 * @type string */ public $AuthType = ''; /** * SMTP realm. * Used for NTLM auth * @type string */ public $Realm = ''; /** * SMTP workstation. * Used for NTLM auth * @type string */ public $Workstation = ''; /** * The SMTP server timeout in seconds. * @type int */ public $Timeout = 10; /** * SMTP class debug output mode. * Options: 0 = off, 1 = commands, 2 = commands and data * @type int * @see SMTP::$do_debug */ public $SMTPDebug = 0; /** * The function/method to use for debugging output. * Options: "echo" or "error_log" * @type string * @see SMTP::$Debugoutput */ public $Debugoutput = "echo"; /** * Whether to keep SMTP connection open after each message. * If this is set to true then to close the connection * requires an explicit call to smtpClose(). * @type bool */ public $SMTPKeepAlive = false; /** * Whether to split multiple to addresses into multiple messages * or send them all in one message. * @type bool */ public $SingleTo = false; /** * Storage for addresses when SingleTo is enabled. * @type array * @todo This should really not be public */ public $SingleToArray = array(); /** * Whether to generate VERP addresses on send. * Only applicable when sending via SMTP. * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path * @type bool */ public $do_verp = false; /** * Whether to allow sending messages with an empty body. * @type bool */ public $AllowEmpty = false; /** * The default line ending. * @note The default remains "\n". We force CRLF where we know * it must be used via self::CRLF. * @type string */ public $LE = "\n"; /** * DKIM selector. * @type string */ public $DKIM_selector = ''; /** * DKIM Identity. * Usually the email address used as the source of the email * @type string */ public $DKIM_identity = ''; /** * DKIM passphrase. * Used if your key is encrypted. * @type string */ public $DKIM_passphrase = ''; /** * DKIM signing domain name. * @example 'example.com' * @type string */ public $DKIM_domain = ''; /** * DKIM private key file path. * @type string */ public $DKIM_private = ''; /** * Callback Action function name. * * The function that handles the result of the send email action. * It is called out by send() for each email sent. * * Value can be any php callable: http://www.php.net/is_callable * * Parameters: * bool $result result of the send action * string $to email address of the recipient * string $cc cc email addresses * string $bcc bcc email addresses * string $subject the subject * string $body the email body * string $from email address of sender * @type string */ public $action_function = ''; /** * What to use in the X-Mailer header. * Options: null for default, whitespace for none, or a string to use * @type string */ public $XMailer = ''; /** * An instance of the SMTP sender class. * @type SMTP * @access protected */ protected $smtp = null; /** * The array of 'to' addresses. * @type array * @access protected */ protected $to = array(); /** * The array of 'cc' addresses. * @type array * @access protected */ protected $cc = array(); /** * The array of 'bcc' addresses. * @type array * @access protected */ protected $bcc = array(); /** * The array of reply-to names and addresses. * @type array * @access protected */ protected $ReplyTo = array(); /** * An array of all kinds of addresses. * Includes all of $to, $cc, $bcc, $replyto * @type array * @access protected */ protected $all_recipients = array(); /** * The array of attachments. * @type array * @access protected */ protected $attachment = array(); /** * The array of custom headers. * @type array * @access protected */ protected $CustomHeader = array(); /** * The most recent Message-ID (including angular brackets). * @type string * @access protected */ protected $lastMessageID = ''; /** * The message's MIME type. * @type string * @access protected */ protected $message_type = ''; /** * The array of MIME boundary strings. * @type array * @access protected */ protected $boundary = array(); /** * The array of available languages. * @type array * @access protected */ protected $language = array(); /** * The number of errors encountered. * @type integer * @access protected */ protected $error_count = 0; /** * The S/MIME certificate file path. * @type string * @access protected */ protected $sign_cert_file = ''; /** * The S/MIME key file path. * @type string * @access protected */ protected $sign_key_file = ''; /** * The S/MIME password for the key. * Used only if the key is encrypted. * @type string * @access protected */ protected $sign_key_pass = ''; /** * Whether to throw exceptions for errors. * @type bool * @access protected */ protected $exceptions = false; /** * Error severity: message only, continue processing */ const STOP_MESSAGE = 0; /** * Error severity: message, likely ok to continue processing */ const STOP_CONTINUE = 1; /** * Error severity: message, plus full stop, critical error reached */ const STOP_CRITICAL = 2; /** * SMTP RFC standard line ending */ const CRLF = "\r\n"; /** * Constructor * @param bool $exceptions Should we throw external exceptions? */ public function __construct($exceptions = false) { $this->exceptions = ($exceptions == true); //Make sure our autoloader is loaded if (version_compare(PHP_VERSION, '5.1.2', '>=')) { $al = spl_autoload_functions(); if ($al === false or !in_array('PHPMailerAutoload', $al)) { require 'PHPMailerAutoload.php'; } } } /** * Destructor. */ public function __destruct() { if ($this->Mailer == 'smtp') { //close any open SMTP connection nicely $this->smtpClose(); } } /** * Call mail() in a safe_mode-aware fashion. * Also, unless sendmail_path points to sendmail (or something that * claims to be sendmail), don't pass params (not a perfect fix, * but it will do) * @param string $to To * @param string $subject Subject * @param string $body Message Body * @param string $header Additional Header(s) * @param string $params Params * @access private * @return bool */ private function mailPassthru($to, $subject, $body, $header, $params) { //Check overloading of mail function to avoid double-encoding if (ini_get('mbstring.func_overload') & 1) { $subject = $this->secureHeader($subject); } else { $subject = $this->encodeHeader($this->secureHeader($subject)); } if (ini_get('safe_mode') || !($this->UseSendmailOptions)) { $rt = @mail($to, $subject, $body, $header); } else { $rt = @mail($to, $subject, $body, $header, $params); } return $rt; } /** * Output debugging info via user-defined method. * Only if debug output is enabled. * @see PHPMailer::$Debugoutput * @see PHPMailer::$SMTPDebug * @param string $str */ protected function edebug($str) { if (!$this->SMTPDebug) { return; } switch ($this->Debugoutput) { case 'error_log': error_log($str); break; case 'html': //Cleans up output a bit for a better looking display that's HTML-safe echo htmlentities(preg_replace('/[\r\n]+/', '', $str), ENT_QUOTES, $this->CharSet) . "<br>\n"; break; case 'echo': default: echo $str."\n"; } } /** * Sets message type to HTML or plain. * @param bool $ishtml True for HTML mode. * @return void */ public function isHTML($ishtml = true) { if ($ishtml) { $this->ContentType = 'text/html'; } else { $this->ContentType = 'text/plain'; } } /** * Send messages using SMTP. * @return void */ public function isSMTP() { $this->Mailer = 'smtp'; } /** * Send messages using PHP's mail() function. * @return void */ public function isMail() { $this->Mailer = 'mail'; } /** * Send messages using $Sendmail. * @return void */ public function isSendmail() { if (!stristr(ini_get('sendmail_path'), 'sendmail')) { $this->Sendmail = '/usr/sbin/sendmail'; } $this->Mailer = 'sendmail'; } /** * Send messages using qmail. * @return void */ public function isQmail() { if (!stristr(ini_get('sendmail_path'), 'qmail')) { $this->Sendmail = '/var/qmail/bin/qmail-inject'; } $this->Mailer = 'qmail'; } /** * Add a "To" address. * @param string $address * @param string $name * @return bool true on success, false if address already used */ public function addAddress($address, $name = '') { return $this->addAnAddress('to', $address, $name); } /** * Add a "CC" address. * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name * @return bool true on success, false if address already used */ public function addCC($address, $name = '') { return $this->addAnAddress('cc', $address, $name); } /** * Add a "BCC" address. * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name * @return bool true on success, false if address already used */ public function addBCC($address, $name = '') { return $this->addAnAddress('bcc', $address, $name); } /** * Add a "Reply-to" address. * @param string $address * @param string $name * @return bool */ public function addReplyTo($address, $name = '') { return $this->addAnAddress('Reply-To', $address, $name); } /** * Add an address to one of the recipient arrays. * Addresses that have been added already return false, but do not throw exceptions * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' * @param string $address The email address to send to * @param string $name * @throws phpmailerException * @return bool true on success, false if address already used or invalid in some way * @access protected */ protected function addAnAddress($kind, $address, $name = '') { if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->setError($this->lang('Invalid recipient array') . ': ' . $kind); $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind); if ($this->exceptions) { throw new phpmailerException('Invalid recipient array: ' . $kind); } return false; } $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->validateAddress($address)) { $this->setError($this->lang('invalid_address') . ': ' . $address); $this->edebug($this->lang('invalid_address') . ': ' . $address); if ($this->exceptions) { throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); } return false; } if ($kind != 'Reply-To') { if (!isset($this->all_recipients[strtolower($address)])) { array_push($this->$kind, array($address, $name)); $this->all_recipients[strtolower($address)] = true; return true; } } else { if (!array_key_exists(strtolower($address), $this->ReplyTo)) { $this->ReplyTo[strtolower($address)] = array($address, $name); return true; } } return false; } /** * Set the From and FromName properties. * @param string $address * @param string $name * @param bool $auto Whether to also set the Sender address, defaults to true * @throws phpmailerException * @return bool */ public function setFrom($address, $name = '', $auto = true) { $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->validateAddress($address)) { $this->setError($this->lang('invalid_address') . ': ' . $address); $this->edebug($this->lang('invalid_address') . ': ' . $address); if ($this->exceptions) { throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); } return false; } $this->From = $address; $this->FromName = $name; if ($auto) { if (empty($this->Sender)) { $this->Sender = $address; } } return true; } /** * Return the Message-ID header of the last email. * Technically this is the value from the last time the headers were created, * but it's also the message ID of the last sent message except in * pathological cases. * @return string */ public function getLastMessageID() { return $this->lastMessageID; } /** * Check that a string looks like an email address. * @param string $address The email address to check * @param string $patternselect A selector for the validation pattern to use : * 'auto' - pick best one automatically; * 'pcre8' - use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; * 'pcre' - use old PCRE implementation; * 'php' - use PHP built-in FILTER_VALIDATE_EMAIL; faster, less thorough; * 'noregex' - super fast, really dumb. * @return bool * @static * @access public */ public static function validateAddress($address, $patternselect = 'auto') { if ($patternselect == 'auto') { if (defined( 'PCRE_VERSION' ) ) { //Check this instead of extension_loaded so it works when that function is disabled if (version_compare(PCRE_VERSION, '8.0') >= 0) { $patternselect = 'pcre8'; } else { $patternselect = 'pcre'; } } else { //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension if (version_compare(PHP_VERSION, '5.2.0') >= 0) { $patternselect = 'php'; } else { $patternselect = 'noregex'; } } } switch ($patternselect) { case 'pcre8': /** * Conforms to RFC5322: Uses *correct* regex on which FILTER_VALIDATE_EMAIL is * based; So why not use FILTER_VALIDATE_EMAIL? Because it was broken to * not allow a@b type valid addresses :( * @link http://squiloople.com/2009/12/20/email-address-validation/ * @copyright 2009-2010 Michael Rushton * Feel free to use and redistribute this code. But please keep this copyright notice. */ return (bool)preg_match( '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', $address ); break; case 'pcre': //An older regex that doesn't need a recent PCRE return (bool)preg_match( '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', $address ); break; case 'php': default: return (bool)filter_var($address, FILTER_VALIDATE_EMAIL); break; case 'noregex': //No PCRE! Do something _very_ approximate! //Check the address is 3 chars or longer and contains an @ that's not the first or last char return (strlen($address) >= 3 and strpos($address, '@') >= 1 and strpos($address, '@') != strlen($address) - 1); break; } } /** * Create a message and send it. * Uses the sending method specified by $Mailer. * @throws phpmailerException * @return bool false on error - See the ErrorInfo property for details of the error. */ public function send() { try { if (!$this->preSend()) { return false; } return $this->postSend(); } catch (phpmailerException $e) { $this->mailHeader = ''; $this->setError($e->getMessage()); if ($this->exceptions) { throw $e; } return false; } } /** * Prepare a message for sending. * @throws phpmailerException * @return bool */ public function preSend() { try { $this->mailHeader = ""; if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL); } // Set whether the message is multipart/alternative if (!empty($this->AltBody)) { $this->ContentType = 'multipart/alternative'; } $this->error_count = 0; // reset errors $this->setMessageType(); // Refuse to send an empty message unless we are specifically allowing it if (!$this->AllowEmpty and empty($this->Body)) { throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL); } $this->MIMEHeader = $this->createHeader(); $this->MIMEBody = $this->createBody(); // To capture the complete message when using mail(), create // an extra header list which createHeader() doesn't fold in if ($this->Mailer == 'mail') { if (count($this->to) > 0) { $this->mailHeader .= $this->addrAppend("To", $this->to); } else { $this->mailHeader .= $this->headerLine("To", "undisclosed-recipients:;"); } $this->mailHeader .= $this->headerLine( 'Subject', $this->encodeHeader($this->secureHeader(trim($this->Subject))) ); } // Sign with DKIM if enabled if (!empty($this->DKIM_domain) && !empty($this->DKIM_private) && !empty($this->DKIM_selector) && !empty($this->DKIM_domain) && file_exists($this->DKIM_private)) { $header_dkim = $this->DKIM_Add( $this->MIMEHeader . $this->mailHeader, $this->encodeHeader($this->secureHeader($this->Subject)), $this->MIMEBody ); $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . str_replace("\r\n", "\n", $header_dkim) . self::CRLF; } return true; } catch (phpmailerException $e) { $this->setError($e->getMessage()); if ($this->exceptions) { throw $e; } return false; } } /** * Actually send a message. * Send the email via the selected mechanism * @throws phpmailerException * @return bool */ public function postSend() { try { // Choose the mailer and send through it switch ($this->Mailer) { case 'sendmail': case 'qmail': return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); case 'smtp': return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); case 'mail': return $this->mailSend($this->MIMEHeader, $this->MIMEBody); default: if (method_exists($this, $this->Mailer.'Send')) { $sendMethod = $this->Mailer.'Send'; return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); } else { return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } } catch (phpmailerException $e) { $this->setError($e->getMessage()); $this->edebug($e->getMessage()); if ($this->exceptions) { throw $e; } } return false; } /** * Send mail using the $Sendmail program. * @param string $header The message headers * @param string $body The message body * @see PHPMailer::$Sendmail * @throws phpmailerException * @access protected * @return bool */ protected function sendmailSend($header, $body) { if ($this->Sender != '') { if ($this->Mailer == 'qmail') { $sendmail = sprintf("%s -f%s", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); } else { $sendmail = sprintf("%s -oi -f%s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); } } else { if ($this->Mailer == 'qmail') { $sendmail = sprintf("%s", escapeshellcmd($this->Sendmail)); } else { $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); } } if ($this->SingleTo === true) { foreach ($this->SingleToArray as $val) { if (!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } fputs($mail, "To: " . $val . "\n"); fputs($mail, $header); fputs($mail, $body); $result = pclose($mail); // implement call back function if it exists $isSent = ($result == 0) ? 1 : 0; $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body, $this->From); if ($result != 0) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } } } else { if (!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } fputs($mail, $header); fputs($mail, $body); $result = pclose($mail); // implement call back function if it exists $isSent = ($result == 0) ? 1 : 0; $this->doCallback($isSent, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); if ($result != 0) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } } return true; } /** * Send mail using the PHP mail() function. * @param string $header The message headers * @param string $body The message body * @link http://www.php.net/manual/en/book.mail.php * @throws phpmailerException * @access protected * @return bool */ protected function mailSend($header, $body) { $toArr = array(); foreach ($this->to as $t) { $toArr[] = $this->addrFormat($t); } $to = implode(', ', $toArr); if (empty($this->Sender)) { $params = " "; } else { $params = sprintf("-f%s", $this->Sender); } if ($this->Sender != '' and !ini_get('safe_mode')) { $old_from = ini_get('sendmail_from'); ini_set('sendmail_from', $this->Sender); } $rt = false; if ($this->SingleTo === true && count($toArr) > 1) { foreach ($toArr as $val) { $rt = $this->mailPassthru($val, $this->Subject, $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body, $this->From); } } else { $rt = $this->mailPassthru($to, $this->Subject, $body, $header, $params); // implement call back function if it exists $isSent = ($rt == 1) ? 1 : 0; $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); } if (isset($old_from)) { ini_set('sendmail_from', $old_from); } if (!$rt) { throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL); } return true; } /** * Get an instance to use for SMTP operations. * Override this function to load your own SMTP implementation * @return SMTP */ public function getSMTPInstance() { if (!is_object($this->smtp)) { $this->smtp = new SMTP; } return $this->smtp; } /** * Send mail via SMTP. * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. * Uses the PHPMailerSMTP class by default. * @see PHPMailer::getSMTPInstance() to use a different class. * @param string $header The message headers * @param string $body The message body * @throws phpmailerException * @uses SMTP * @access protected * @return bool */ protected function smtpSend($header, $body) { $bad_rcpt = array(); if (!$this->smtpConnect()) { throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); } $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; if (!$this->smtp->mail($smtp_from)) { $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); } // Attempt to send to all recipients foreach ($this->to as $to) { if (!$this->smtp->recipient($to[0])) { $bad_rcpt[] = $to[0]; $isSent = 0; } else { $isSent = 1; } $this->doCallback($isSent, $to[0], '', '', $this->Subject, $body, $this->From); } foreach ($this->cc as $cc) { if (!$this->smtp->recipient($cc[0])) { $bad_rcpt[] = $cc[0]; $isSent = 0; } else { $isSent = 1; } $this->doCallback($isSent, '', $cc[0], '', $this->Subject, $body, $this->From); } foreach ($this->bcc as $bcc) { if (!$this->smtp->recipient($bcc[0])) { $bad_rcpt[] = $bcc[0]; $isSent = 0; } else { $isSent = 1; } $this->doCallback($isSent, '', '', $bcc[0], $this->Subject, $body, $this->From); } //Only send the DATA command if we have viable recipients if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); } if ($this->SMTPKeepAlive == true) { $this->smtp->reset(); } else { $this->smtp->quit(); $this->smtp->close(); } if (count($bad_rcpt) > 0) { //Create error message for any bad addresses throw new phpmailerException( $this->lang('recipients_failed') . implode(', ', $bad_rcpt), self::STOP_CONTINUE ); } return true; } /** * Initiate a connection to an SMTP server. * Returns false if the operation failed. * @param array $options An array of options compatible with stream_context_create() * @uses SMTP * @access public * @throws phpmailerException * @return bool */ public function smtpConnect($options = array()) { if (is_null($this->smtp)) { $this->smtp = $this->getSMTPInstance(); } //Already connected? if ($this->smtp->connected()) { return true; } $this->smtp->setTimeout($this->Timeout); $this->smtp->setDebugLevel($this->SMTPDebug); $this->smtp->setDebugOutput($this->Debugoutput); $this->smtp->setVerp($this->do_verp); $hosts = explode(';', $this->Host); $lastexception = null; foreach ($hosts as $hostentry) { $hostinfo = array(); if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) { //Not a valid host entry continue; } //$hostinfo[2]: optional ssl or tls prefix //$hostinfo[3]: the hostname //$hostinfo[4]: optional port number //The host string prefix can temporarily override the current setting for SMTPSecure //If it's not specified, the default value is used $prefix = ''; $tls = ($this->SMTPSecure == 'tls'); if ($hostinfo[2] == 'ssl' or ($hostinfo[2] == '' and $this->SMTPSecure == 'ssl')) { $prefix = 'ssl://'; $tls = false; //Can't have SSL and TLS at once } elseif ($hostinfo[2] == 'tls') { $tls = true; //tls doesn't use a prefix } $host = $hostinfo[3]; $port = $this->Port; $tport = (integer)$hostinfo[4]; if ($tport > 0 and $tport < 65536) { $port = $tport; } if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { try { if ($this->Helo) { $hello = $this->Helo; } else { $hello = $this->serverHostname(); } $this->smtp->hello($hello); if ($tls) { if (!$this->smtp->startTLS()) { throw new phpmailerException($this->lang('connect_host')); } //We must resend HELO after tls negotiation $this->smtp->hello($hello); } if ($this->SMTPAuth) { if (!$this->smtp->authenticate( $this->Username, $this->Password, $this->AuthType, $this->Realm, $this->Workstation ) ) { throw new phpmailerException($this->lang('authenticate')); } } return true; } catch (phpmailerException $e) { $lastexception = $e; //We must have connected, but then failed TLS or Auth, so close connection nicely $this->smtp->quit(); } } } //If we get here, all connection attempts have failed, so close connection hard $this->smtp->close(); //As we've caught all exceptions, just report whatever the last one was if ($this->exceptions and !is_null($lastexception)) { throw $lastexception; } return false; } /** * Close the active SMTP session if one exists. * @return void */ public function smtpClose() { if ($this->smtp !== null) { if ($this->smtp->connected()) { $this->smtp->quit(); $this->smtp->close(); } } } /** * Set the language for error messages. * Returns false if it cannot load the language file. * The default language is English. * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") * @param string $lang_path Path to the language file directory, with trailing separator (slash) * @return bool * @access public */ public function setLanguage($langcode = 'en', $lang_path = 'language/') { //Define full set of translatable strings $PHPMAILER_LANG = array( 'authenticate' => 'SMTP Error: Could not authenticate.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'data_not_accepted' => 'SMTP Error: data not accepted.', 'empty_message' => 'Message body empty', 'encoding' => 'Unknown encoding: ', 'execute' => 'Could not execute: ', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'from_failed' => 'The following From address failed: ', 'instantiate' => 'Could not instantiate mail function.', 'invalid_address' => 'Invalid address', 'mailer_not_supported' => ' mailer is not supported.', 'provide_address' => 'You must provide at least one recipient email address.', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'signing' => 'Signing Error: ', 'smtp_connect_failed' => 'SMTP connect() failed.', 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ' ); //Overwrite language-specific strings. //This way we'll never have missing translations - no more "language string failed to load"! $l = true; $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; if ($langcode != 'en') { //There is no English translation file //Make sure language file path is readable if (!is_readable($lang_file)) { $l = false; } else { $l = include $lang_file; } } $this->language = $PHPMAILER_LANG; return ($l == true); //Returns false if language not found } /** * Get the array of strings for the current language. * @return array */ public function getTranslations() { return $this->language; } /** * Create recipient headers. * @access public * @param string $type * @param array $addr An array of recipient, * where each recipient is a 2-element indexed array with element 0 containing an address * and element 1 containing a name, like: * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User')) * @return string */ public function addrAppend($type, $addr) { $addresses = array(); foreach ($addr as $a) { $addresses[] = $this->addrFormat($a); } return $type . ': ' . implode(', ', $addresses) . $this->LE; } /** * Format an address for use in a message header. * @access public * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name * like array('joe@example.com', 'Joe User') * @return string */ public function addrFormat($addr) { if (empty($addr[1])) { // No name provided return $this->secureHeader($addr[0]); } else { return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . " <" . $this->secureHeader( $addr[0] ) . ">"; } } /** * Word-wrap message. * For use with mailers that do not automatically perform wrapping * and for quoted-printable encoded messages. * Original written by philippe. * @param string $message The message to wrap * @param integer $length The line length to wrap to * @param bool $qp_mode Whether to run in Quoted-Printable mode * @access public * @return string */ public function wrapText($message, $length, $qp_mode = false) { $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; // If utf-8 encoding is used, we will need to make sure we don't // split multibyte characters when we wrap $is_utf8 = (strtolower($this->CharSet) == "utf-8"); $lelen = strlen($this->LE); $crlflen = strlen(self::CRLF); $message = $this->fixEOL($message); if (substr($message, -$lelen) == $this->LE) { $message = substr($message, 0, -$lelen); } $line = explode($this->LE, $message); // Magic. We know fixEOL uses $LE $message = ''; for ($i = 0; $i < count($line); $i++) { $line_part = explode(' ', $line[$i]); $buf = ''; for ($e = 0; $e < count($line_part); $e++) { $word = $line_part[$e]; if ($qp_mode and (strlen($word) > $length)) { $space_left = $length - strlen($buf) - $crlflen; if ($e != 0) { if ($space_left > 20) { $len = $space_left; if ($is_utf8) { $len = $this->utf8CharBoundary($word, $len); } elseif (substr($word, $len - 1, 1) == "=") { $len--; } elseif (substr($word, $len - 2, 1) == "=") { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); $buf .= ' ' . $part; $message .= $buf . sprintf("=%s", self::CRLF); } else { $message .= $buf . $soft_break; } $buf = ''; } while (strlen($word) > 0) { if ($length <= 0) { break; } $len = $length; if ($is_utf8) { $len = $this->utf8CharBoundary($word, $len); } elseif (substr($word, $len - 1, 1) == "=") { $len--; } elseif (substr($word, $len - 2, 1) == "=") { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); if (strlen($word) > 0) { $message .= $part . sprintf("=%s", self::CRLF); } else { $buf = $part; } } } else { $buf_o = $buf; $buf .= ($e == 0) ? $word : (' ' . $word); if (strlen($buf) > $length and $buf_o != '') { $message .= $buf_o . $soft_break; $buf = $word; } } } $message .= $buf . self::CRLF; } return $message; } /** * Find the last character boundary prior to $maxLength in a utf-8 * quoted (printable) encoded string. * Original written by Colin Brown. * @access public * @param string $encodedText utf-8 QP text * @param int $maxLength find last character boundary prior to this length * @return int */ public function utf8CharBoundary($encodedText, $maxLength) { $foundSplitPos = false; $lookBack = 3; while (!$foundSplitPos) { $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); $encodedCharPos = strpos($lastChunk, "="); if ($encodedCharPos !== false) { // Found start of encoded character byte within $lookBack block. // Check the encoded byte value (the 2 chars after the '=') $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); $dec = hexdec($hex); if ($dec < 128) { // Single byte character. // If the encoded char was found at pos 0, it will fit // otherwise reduce maxLength to start of the encoded char $maxLength = ($encodedCharPos == 0) ? $maxLength : $maxLength - ($lookBack - $encodedCharPos); $foundSplitPos = true; } elseif ($dec >= 192) { // First byte of a multi byte character // Reduce maxLength to split at start of character $maxLength = $maxLength - ($lookBack - $encodedCharPos); $foundSplitPos = true; } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back $lookBack += 3; } } else { // No encoded character found $foundSplitPos = true; } } return $maxLength; } /** * Set the body wrapping. * @access public * @return void */ public function setWordWrap() { if ($this->WordWrap < 1) { return; } switch ($this->message_type) { case 'alt': case 'alt_inline': case 'alt_attach': case 'alt_inline_attach': $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); break; default: $this->Body = $this->wrapText($this->Body, $this->WordWrap); break; } } /** * Assemble message headers. * @access public * @return string The assembled headers */ public function createHeader() { $result = ''; // Set the boundaries $uniq_id = md5(uniqid(time())); $this->boundary[1] = 'b1_' . $uniq_id; $this->boundary[2] = 'b2_' . $uniq_id; $this->boundary[3] = 'b3_' . $uniq_id; if ($this->MessageDate == '') { $result .= $this->headerLine('Date', self::rfcDate()); } else { $result .= $this->headerLine('Date', $this->MessageDate); } if ($this->ReturnPath) { $result .= $this->headerLine('Return-Path', '<' . trim($this->ReturnPath) . '>'); } elseif ($this->Sender == '') { $result .= $this->headerLine('Return-Path', '<' . trim($this->From) . '>'); } else { $result .= $this->headerLine('Return-Path', '<' . trim($this->Sender) . '>'); } // To be created automatically by mail() if ($this->Mailer != 'mail') { if ($this->SingleTo === true) { foreach ($this->to as $t) { $this->SingleToArray[] = $this->addrFormat($t); } } else { if (count($this->to) > 0) { $result .= $this->addrAppend('To', $this->to); } elseif (count($this->cc) == 0) { $result .= $this->headerLine('To', 'undisclosed-recipients:;'); } } } $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName))); // sendmail and mail() extract Cc from the header before sending if (count($this->cc) > 0) { $result .= $this->addrAppend('Cc', $this->cc); } // sendmail and mail() extract Bcc from the header before sending if (( $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail' ) and count($this->bcc) > 0 ) { $result .= $this->addrAppend('Bcc', $this->bcc); } if (count($this->ReplyTo) > 0) { $result .= $this->addrAppend('Reply-To', $this->ReplyTo); } // mail() sets the subject itself if ($this->Mailer != 'mail') { $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); } if ($this->MessageID != '') { $this->lastMessageID = $this->MessageID; } else { $this->lastMessageID = sprintf("<%s@%s>", $uniq_id, $this->ServerHostname()); } $result .= $this->HeaderLine('Message-ID', $this->lastMessageID); $result .= $this->headerLine('X-Priority', $this->Priority); if ($this->XMailer == '') { $result .= $this->headerLine( 'X-Mailer', 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer/)' ); } else { $myXmailer = trim($this->XMailer); if ($myXmailer) { $result .= $this->headerLine('X-Mailer', $myXmailer); } } if ($this->ConfirmReadingTo != '') { $result .= $this->headerLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); } // Add custom headers for ($index = 0; $index < count($this->CustomHeader); $index++) { $result .= $this->headerLine( trim($this->CustomHeader[$index][0]), $this->encodeHeader(trim($this->CustomHeader[$index][1])) ); } if (!$this->sign_key_file) { $result .= $this->headerLine('MIME-Version', '1.0'); $result .= $this->getMailMIME(); } return $result; } /** * Get the message MIME type headers. * @access public * @return string */ public function getMailMIME() { $result = ''; switch ($this->message_type) { case 'inline': $result .= $this->headerLine('Content-Type', 'multipart/related;'); $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); break; case 'attach': case 'inline_attach': case 'alt_attach': case 'alt_inline_attach': $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); break; case 'alt': case 'alt_inline': $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); break; default: // Catches case 'plain': and case '': $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); break; } //RFC1341 part 5 says 7bit is assumed if not specified if ($this->Encoding != '7bit') { $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); } if ($this->Mailer != 'mail') { $result .= $this->LE; } return $result; } /** * Returns the whole MIME message. * Includes complete headers and body. * Only valid post PreSend(). * @see PHPMailer::PreSend() * @access public * @return string */ public function getSentMIMEMessage() { return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody; } /** * Assemble the message body. * Returns an empty string on failure. * @access public * @throws phpmailerException * @return string The assembled message body */ public function createBody() { $body = ''; if ($this->sign_key_file) { $body .= $this->getMailMIME() . $this->LE; } $this->setWordWrap(); $bodyEncoding = $this->Encoding; $bodyCharSet = $this->CharSet; if (!$this->has8bitChars($this->Body)) { $bodyEncoding = '7bit'; $bodyCharSet = 'us-ascii'; } $altBodyEncoding = $this->Encoding; $altBodyCharSet = $this->CharSet; if (!$this->has8bitChars($this->AltBody)) { $altBodyEncoding = '7bit'; $altBodyCharSet = 'us-ascii'; } switch ($this->message_type) { case 'inline': $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[1]); break; case 'attach': $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; case 'inline_attach': $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[2]); $body .= $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; case 'alt': $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; if (!empty($this->Ical)) { $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); $body .= $this->encodeString($this->Ical, $this->Encoding); $body .= $this->LE . $this->LE; } $body .= $this->endBoundary($this->boundary[1]); break; case 'alt_inline': $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[2]); $body .= $this->LE; $body .= $this->endBoundary($this->boundary[1]); break; case 'alt_attach': $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->endBoundary($this->boundary[2]); $body .= $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; case 'alt_inline_attach': $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->textLine('--' . $this->boundary[2]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[3]); $body .= $this->LE; $body .= $this->endBoundary($this->boundary[2]); $body .= $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; default: // catch case 'plain' and case '' $body .= $this->encodeString($this->Body, $bodyEncoding); break; } if ($this->isError()) { $body = ''; } elseif ($this->sign_key_file) { try { if (!defined('PKCS7_TEXT')) { throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); } //TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 $file = tempnam(sys_get_temp_dir(), 'mail'); file_put_contents($file, $body); //TODO check this worked $signed = tempnam(sys_get_temp_dir(), 'signed'); if (@openssl_pkcs7_sign( $file, $signed, 'file://' . realpath($this->sign_cert_file), array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), null ) ) { @unlink($file); $body = file_get_contents($signed); @unlink($signed); } else { @unlink($file); @unlink($signed); throw new phpmailerException($this->lang('signing') . openssl_error_string()); } } catch (phpmailerException $e) { $body = ''; if ($this->exceptions) { throw $e; } } } return $body; } /** * Return the start of a message boundary. * @access protected * @param string $boundary * @param string $charSet * @param string $contentType * @param string $encoding * @return string */ protected function getBoundary($boundary, $charSet, $contentType, $encoding) { $result = ''; if ($charSet == '') { $charSet = $this->CharSet; } if ($contentType == '') { $contentType = $this->ContentType; } if ($encoding == '') { $encoding = $this->Encoding; } $result .= $this->textLine('--' . $boundary); $result .= sprintf("Content-Type: %s; charset=%s", $contentType, $charSet); $result .= $this->LE; //RFC1341 part 5 says 7bit is assumed if not specified if ($encoding != '7bit') { $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); } $result .= $this->LE; return $result; } /** * Return the end of a message boundary. * @access protected * @param string $boundary * @return string */ protected function endBoundary($boundary) { return $this->LE . '--' . $boundary . '--' . $this->LE; } /** * Set the message type. * PHPMailer only supports some preset message types, * not arbitrary MIME structures. * @access protected * @return void */ protected function setMessageType() { $this->message_type = array(); if ($this->alternativeExists()) { $this->message_type[] = "alt"; } if ($this->inlineImageExists()) { $this->message_type[] = "inline"; } if ($this->attachmentExists()) { $this->message_type[] = "attach"; } $this->message_type = implode("_", $this->message_type); if ($this->message_type == "") { $this->message_type = "plain"; } } /** * Format a header line. * @access public * @param string $name * @param string $value * @return string */ public function headerLine($name, $value) { return $name . ': ' . $value . $this->LE; } /** * Return a formatted mail line. * @access public * @param string $value * @return string */ public function textLine($value) { return $value . $this->LE; } /** * Add an attachment from a path on the filesystem. * Returns false if the file could not be found or read. * @param string $path Path to the attachment. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @param string $disposition Disposition to use * @throws phpmailerException * @return bool */ public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') { try { if (!@is_file($path)) { throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE); } //If a MIME type is not specified, try to work it out from the file name if ($type == '') { $type = self::filenameToType($path); } $filename = basename($path); if ($name == '') { $name = $filename; } $this->attachment[] = array( 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, // isStringAttachment 6 => $disposition, 7 => 0 ); } catch (phpmailerException $e) { $this->setError($e->getMessage()); $this->edebug($e->getMessage()); if ($this->exceptions) { throw $e; } return false; } return true; } /** * Return the array of attachments. * @return array */ public function getAttachments() { return $this->attachment; } /** * Attach all file, string, and binary attachments to the message. * Returns an empty string on failure. * @access protected * @param string $disposition_type * @param string $boundary * @return string */ protected function attachAll($disposition_type, $boundary) { // Return text of body $mime = array(); $cidUniq = array(); $incl = array(); // Add all attachments foreach ($this->attachment as $attachment) { // Check if it is a valid disposition_filter if ($attachment[6] == $disposition_type) { // Check for string attachment $string = ''; $path = ''; $bString = $attachment[5]; if ($bString) { $string = $attachment[0]; } else { $path = $attachment[0]; } $inclhash = md5(serialize($attachment)); if (in_array($inclhash, $incl)) { continue; } $incl[] = $inclhash; $name = $attachment[2]; $encoding = $attachment[3]; $type = $attachment[4]; $disposition = $attachment[6]; $cid = $attachment[7]; if ($disposition == 'inline' && isset($cidUniq[$cid])) { continue; } $cidUniq[$cid] = true; $mime[] = sprintf("--%s%s", $boundary, $this->LE); $mime[] = sprintf( "Content-Type: %s; name=\"%s\"%s", $type, $this->encodeHeader($this->secureHeader($name)), $this->LE ); //RFC1341 part 5 says 7bit is assumed if not specified if ($encoding != '7bit') { $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); } if ($disposition == 'inline') { $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); } // If a filename contains any of these chars, it should be quoted, // but not otherwise: RFC2183 & RFC2045 5.1 // Fixes a warning in IETF's msglint MIME checker // Allow for bypassing the Content-Disposition header totally if (!(empty($disposition))) { if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $name)) { $mime[] = sprintf( "Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->encodeHeader($this->secureHeader($name)), $this->LE . $this->LE ); } else { $mime[] = sprintf( "Content-Disposition: %s; filename=%s%s", $disposition, $this->encodeHeader($this->secureHeader($name)), $this->LE . $this->LE ); } } else { $mime[] = $this->LE; } // Encode as string attachment if ($bString) { $mime[] = $this->encodeString($string, $encoding); if ($this->isError()) { return ''; } $mime[] = $this->LE . $this->LE; } else { $mime[] = $this->encodeFile($path, $encoding); if ($this->isError()) { return ''; } $mime[] = $this->LE . $this->LE; } } } $mime[] = sprintf("--%s--%s", $boundary, $this->LE); return implode("", $mime); } /** * Encode a file attachment in requested format. * Returns an empty string on failure. * @param string $path The full path to the file * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * @throws phpmailerException * @see EncodeFile(encodeFile * @access protected * @return string */ protected function encodeFile($path, $encoding = 'base64') { try { if (!is_readable($path)) { throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); } $magic_quotes = get_magic_quotes_runtime(); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime(0); } else { ini_set('magic_quotes_runtime', 0); } } $file_buffer = file_get_contents($path); $file_buffer = $this->encodeString($file_buffer, $encoding); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime($magic_quotes); } else { ini_set('magic_quotes_runtime', $magic_quotes); } } return $file_buffer; } catch (Exception $e) { $this->setError($e->getMessage()); return ''; } } /** * Encode a string in requested format. * Returns an empty string on failure. * @param string $str The text to encode * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * @access public * @return string */ public function encodeString($str, $encoding = 'base64') { $encoded = ''; switch (strtolower($encoding)) { case 'base64': $encoded = chunk_split(base64_encode($str), 76, $this->LE); break; case '7bit': case '8bit': $encoded = $this->fixEOL($str); //Make sure it ends with a line break if (substr($encoded, -(strlen($this->LE))) != $this->LE) { $encoded .= $this->LE; } break; case 'binary': $encoded = $str; break; case 'quoted-printable': $encoded = $this->encodeQP($str); break; default: $this->setError($this->lang('encoding') . $encoding); break; } return $encoded; } /** * Encode a header string optimally. * Picks shortest of Q, B, quoted-printable or none. * @access public * @param string $str * @param string $position * @return string */ public function encodeHeader($str, $position = 'text') { $x = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { // Can't use addslashes as we don't know the value of magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return ($encoded); } else { return ("\"$encoded\""); } } $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; /** @noinspection PhpMissingBreakStatementInspection */ case 'comment': $x = preg_match_all('/[()"]/', $str, $matches); // Intentional fall-through case 'text': default: $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } if ($x == 0) { //There are no chars that need encoding return ($str); } $maxlen = 75 - 7 - strlen($this->CharSet); // Try to select the encoding which should produce the shortest output if ($x > strlen($str) / 3) { //More than a third of the content will need encoding, so B encoding will be most efficient $encoding = 'B'; if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { // Use a custom function which correctly encodes and wraps long // multibyte strings without breaking lines within a character $encoded = $this->base64EncodeWrapMB($str, "\n"); } else { $encoded = base64_encode($str); $maxlen -= $maxlen % 4; $encoded = trim(chunk_split($encoded, $maxlen, "\n")); } } else { $encoding = 'Q'; $encoded = $this->encodeQ($str, $position); $encoded = $this->wrapText($encoded, $maxlen, true); $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); } $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); $encoded = trim(str_replace("\n", $this->LE, $encoded)); return $encoded; } /** * Check if a string contains multi-byte characters. * @access public * @param string $str multi-byte text to wrap encode * @return bool */ public function hasMultiBytes($str) { if (function_exists('mb_strlen')) { return (strlen($str) > mb_strlen($str, $this->CharSet)); } else { // Assume no multibytes (we can't handle without mbstring functions anyway) return false; } } /** * Does a string contain any 8-bit chars (in any charset)? * @param string $text * @return bool */ public function has8bitChars($text) { return (bool)preg_match('/[\x80-\xFF]/', $text); } /** * Encode and wrap long multibyte strings for mail headers * without breaking lines within a character. * Adapted from a function by paravoid * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 * @access public * @param string $str multi-byte text to wrap encode * @param string $lf string to use as linefeed/end-of-line * @return string */ public function base64EncodeWrapMB($str, $lf = null) { $start = "=?" . $this->CharSet . "?B?"; $end = "?="; $encoded = ""; if ($lf === null) { $lf = $this->LE; } $mb_length = mb_strlen($str, $this->CharSet); // Each line must have length <= 75, including $start and $end $length = 75 - strlen($start) - strlen($end); // Average multi-byte ratio $ratio = $mb_length / strlen($str); // Base64 has a 4:3 ratio $avgLength = floor($length * $ratio * .75); for ($i = 0; $i < $mb_length; $i += $offset) { $lookBack = 0; do { $offset = $avgLength - $lookBack; $chunk = mb_substr($str, $i, $offset, $this->CharSet); $chunk = base64_encode($chunk); $lookBack++; } while (strlen($chunk) > $length); $encoded .= $chunk . $lf; } // Chomp the last linefeed $encoded = substr($encoded, 0, -strlen($lf)); return $encoded; } /** * Encode a string in quoted-printable format. * According to RFC2045 section 6.7. * @access public * @param string $string The text to encode * @param integer $line_max Number of chars allowed on a line before wrapping * @return string * @link PHP version adapted from http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 */ public function encodeQP($string, $line_max = 76) { if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3) return $this->fixEOL(quoted_printable_encode($string)); } //Fall back to a pure PHP implementation $string = str_replace( array('%20', '%0D%0A.', '%0D%0A', '%'), array(' ', "\r\n=2E", "\r\n", '='), rawurlencode($string) ); $string = preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); return $this->fixEOL($string); } /** * Backward compatibility wrapper for an old QP encoding function that was removed. * @see PHPMailer::encodeQP() * @access public * @param string $string * @param integer $line_max * @param bool $space_conv * @return string * @deprecated Use encodeQP instead. */ public function encodeQPphp( $string, $line_max = 76, /** @noinspection PhpUnusedParameterInspection */ $space_conv = false ) { return $this->encodeQP($string, $line_max); } /** * Encode a string using Q encoding. * @link http://tools.ietf.org/html/rfc2047 * @param string $str the text to encode * @param string $position Where the text is going to be used, see the RFC for what that means * @access public * @return string */ public function encodeQ($str, $position = 'text') { //There should not be any EOL in the string $pattern = ''; $encoded = str_replace(array("\r", "\n"), '', $str); switch (strtolower($position)) { case 'phrase': //RFC 2047 section 5.3 $pattern = '^A-Za-z0-9!*+\/ -'; break; /** @noinspection PhpMissingBreakStatementInspection */ case 'comment': //RFC 2047 section 5.2 $pattern = '\(\)"'; //intentional fall-through //for this reason we build the $pattern without including delimiters and [] case 'text': default: //RFC 2047 section 5.1 //Replace every high ascii, control, =, ? and _ characters $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; break; } $matches = array(); if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { //If the string contains an '=', make sure it's the first thing we replace //so as to avoid double-encoding $s = array_search('=', $matches[0]); if ($s !== false) { unset($matches[0][$s]); array_unshift($matches[0], '='); } foreach (array_unique($matches[0]) as $char) { $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); } } //Replace every spaces to _ (more readable than =20) return str_replace(' ', '_', $encoded); } /** * Add a string or binary attachment (non-filesystem). * This method can be used to attach ascii or binary data, * such as a BLOB record from a database. * @param string $string String attachment data. * @param string $filename Name of the attachment. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @param string $disposition Disposition to use * @return void */ public function addStringAttachment( $string, $filename, $encoding = 'base64', $type = '', $disposition = 'attachment' ) { //If a MIME type is not specified, try to work it out from the file name if ($type == '') { $type = self::filenameToType($filename); } // Append to $attachment array $this->attachment[] = array( 0 => $string, 1 => $filename, 2 => basename($filename), 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment 6 => $disposition, 7 => 0 ); } /** * Add an embedded (inline) attachment from a file. * This can include images, sounds, and just about any other document type. * These differ from 'regular' attachmants in that they are intended to be * displayed inline with the message, not just attached for download. * This is used in HTML messages that embed the images * the HTML refers to using the $cid value. * @param string $path Path to the attachment. * @param string $cid Content ID of the attachment; Use this to reference * the content when using an embedded image in HTML. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File MIME type. * @param string $disposition Disposition to use * @return bool True on successfully adding an attachment */ public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') { if (!@is_file($path)) { $this->setError($this->lang('file_access') . $path); return false; } //If a MIME type is not specified, try to work it out from the file name if ($type == '') { $type = self::filenameToType($path); } $filename = basename($path); if ($name == '') { $name = $filename; } // Append to $attachment array $this->attachment[] = array( 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, // isStringAttachment 6 => $disposition, 7 => $cid ); return true; } /** * Add an embedded stringified attachment. * This can include images, sounds, and just about any other document type. * Be sure to set the $type to an image type for images: * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. * @param string $string The attachment binary data. * @param string $cid Content ID of the attachment; Use this to reference * the content when using an embedded image in HTML. * @param string $name * @param string $encoding File encoding (see $Encoding). * @param string $type MIME type. * @param string $disposition Disposition to use * @return bool True on successfully adding an attachment */ public function addStringEmbeddedImage( $string, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline' ) { //If a MIME type is not specified, try to work it out from the name if ($type == '') { $type = self::filenameToType($name); } // Append to $attachment array $this->attachment[] = array( 0 => $string, 1 => $name, 2 => $name, 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment 6 => $disposition, 7 => $cid ); return true; } /** * Check if an inline attachment is present. * @access public * @return bool */ public function inlineImageExists() { foreach ($this->attachment as $attachment) { if ($attachment[6] == 'inline') { return true; } } return false; } /** * Check if an attachment (non-inline) is present. * @return bool */ public function attachmentExists() { foreach ($this->attachment as $attachment) { if ($attachment[6] == 'attachment') { return true; } } return false; } /** * Check if this message has an alternative body set. * @return bool */ public function alternativeExists() { return !empty($this->AltBody); } /** * Clear all To recipients. * @return void */ public function clearAddresses() { foreach ($this->to as $to) { unset($this->all_recipients[strtolower($to[0])]); } $this->to = array(); } /** * Clear all CC recipients. * @return void */ public function clearCCs() { foreach ($this->cc as $cc) { unset($this->all_recipients[strtolower($cc[0])]); } $this->cc = array(); } /** * Clear all BCC recipients. * @return void */ public function clearBCCs() { foreach ($this->bcc as $bcc) { unset($this->all_recipients[strtolower($bcc[0])]); } $this->bcc = array(); } /** * Clear all ReplyTo recipients. * @return void */ public function clearReplyTos() { $this->ReplyTo = array(); } /** * Clear all recipient types. * @return void */ public function clearAllRecipients() { $this->to = array(); $this->cc = array(); $this->bcc = array(); $this->all_recipients = array(); } /** * Clear all filesystem, string, and binary attachments. * @return void */ public function clearAttachments() { $this->attachment = array(); } /** * Clear all custom headers. * @return void */ public function clearCustomHeaders() { $this->CustomHeader = array(); } /** * Add an error message to the error container. * @access protected * @param string $msg * @return void */ protected function setError($msg) { $this->error_count++; if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { $lasterror = $this->smtp->getError(); if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) { $msg .= '<p>' . $this->lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n"; } } $this->ErrorInfo = $msg; } /** * Return an RFC 822 formatted date. * @access public * @return string * @static */ public static function rfcDate() { //Set the time zone to whatever the default is to avoid 500 errors //Will default to UTC if it's not set properly in php.ini date_default_timezone_set(@date_default_timezone_get()); return date('D, j M Y H:i:s O'); } /** * Get the server hostname. * Returns 'localhost.localdomain' if unknown. * @access protected * @return string */ protected function serverHostname() { $result = 'localhost.localdomain'; if (!empty($this->Hostname)) { $result = $this->Hostname; } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { $result = $_SERVER['SERVER_NAME']; } elseif (function_exists('gethostname') && gethostname() !== false) { $result = gethostname(); } elseif (php_uname('n') !== false) { $result = php_uname('n'); } return $result; } /** * Get an error message in the current language. * @access protected * @param string $key * @return string */ protected function lang($key) { if (count($this->language) < 1) { $this->setLanguage('en'); // set the default language } if (isset($this->language[$key])) { return $this->language[$key]; } else { return 'Language string failed to load: ' . $key; } } /** * Check if an error occurred. * @access public * @return bool True if an error did occur. */ public function isError() { return ($this->error_count > 0); } /** * Ensure consistent line endings in a string. * Changes every end of line from CRLF, CR or LF to $this->LE. * @access public * @param string $str String to fixEOL * @return string */ public function fixEOL($str) { // Normalise to \n $nstr = str_replace(array("\r\n", "\r"), "\n", $str); // Now convert LE as needed if ($this->LE !== "\n") { $nstr = str_replace("\n", $this->LE, $nstr); } return $nstr; } /** * Add a custom header. * $name value can be overloaded to contain * both header name and value (name:value) * @access public * @param string $name Custom header name * @param string $value Header value * @return void */ public function addCustomHeader($name, $value = null) { if ($value === null) { // Value passed in as name:value $this->CustomHeader[] = explode(':', $name, 2); } else { $this->CustomHeader[] = array($name, $value); } } /** * Create a message from an HTML string. * Automatically makes modifications for inline images and backgrounds * and creates a plain-text version by converting the HTML. * Overwrites any existing values in $this->Body and $this->AltBody * @access public * @param string $message HTML message string * @param string $basedir baseline directory for path * @param bool $advanced Whether to use the advanced HTML to text converter * @return string $message */ public function msgHTML($message, $basedir = '', $advanced = false) { preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); if (isset($images[2])) { foreach ($images[2] as $i => $url) { // do not change urls for absolute images (thanks to corvuscorax) if (!preg_match('#^[A-z]+://#', $url)) { $filename = basename($url); $directory = dirname($url); if ($directory == '.') { $directory = ''; } $cid = md5($url) . '@phpmailer.0'; //RFC2392 S 2 if (strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } if (strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; } if ($this->addEmbeddedImage( $basedir . $directory . $filename, $cid, $filename, 'base64', self::_mime_types(self::mb_pathinfo($filename, PATHINFO_EXTENSION)) ) ) { $message = preg_replace( "/" . $images[1][$i] . "=[\"']" . preg_quote($url, '/') . "[\"']/Ui", $images[1][$i] . "=\"cid:" . $cid . "\"", $message ); } } } } $this->isHTML(true); //Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better $this->Body = $this->normalizeBreaks($message); $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); if (empty($this->AltBody)) { $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . self::CRLF . self::CRLF; } return $this->Body; } /** * Convert an HTML string into plain text. * @param string $html The HTML text to convert * @param bool $advanced Should this use the more complex html2text converter or just a simple one? * @return string */ public function html2text($html, $advanced = false) { if ($advanced) { require_once 'extras/class.html2text.php'; $h = new html2text($html); return $h->get_text(); } return html_entity_decode( trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), ENT_QUOTES, $this->CharSet ); } /** * Get the MIME type for a file extension. * @param string $ext File extension * @access public * @return string MIME type of file. * @static */ public static function _mime_types($ext = '') { $mimes = array( 'xl' => 'application/excel', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'bin' => 'application/macbinary', 'doc' => 'application/msword', 'word' => 'application/msword', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'psd' => 'application/octet-stream', 'sea' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'gtar' => 'application/x-gtar', 'php3' => 'application/x-httpd-php', 'php4' => 'application/x-httpd-php', 'php' => 'application/x-httpd-php', 'phtml' => 'application/x-httpd-php', 'phps' => 'application/x-httpd-php-source', 'js' => 'application/x-javascript', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'tar' => 'application/x-tar', 'tgz' => 'application/x-tar', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'zip' => 'application/zip', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'eml' => 'message/rfc822', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'shtml' => 'text/html', 'log' => 'text/plain', 'text' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'rv' => 'video/vnd.rn-realvideo', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie' ); return (array_key_exists(strtolower($ext), $mimes) ? $mimes[strtolower($ext)]: 'application/octet-stream'); } /** * Map a file name to a MIME type. * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. * @param string $filename A file name or full path, does not need to exist as a file * @return string * @static */ public static function filenameToType($filename) { //In case the path is a URL, strip any query string before getting extension $qpos = strpos($filename, '?'); if ($qpos !== false) { $filename = substr($filename, 0, $qpos); } $pathinfo = self::mb_pathinfo($filename); return self::_mime_types($pathinfo['extension']); } /** * Multi-byte-safe pathinfo replacement. * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. * Works similarly to the one in PHP >= 5.2.0 * @link http://www.php.net/manual/en/function.pathinfo.php#107461 * @param string $path A filename or path, does not need to exist as a file * @param integer|string $options Either a PATHINFO_* constant, * or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2 * @return string|array * @static */ public static function mb_pathinfo($path, $options = null) { $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''); $m = array(); preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $m); if (array_key_exists(1, $m)) { $ret['dirname'] = $m[1]; } if (array_key_exists(2, $m)) { $ret['basename'] = $m[2]; } if (array_key_exists(5, $m)) { $ret['extension'] = $m[5]; } if (array_key_exists(3, $m)) { $ret['filename'] = $m[3]; } switch ($options) { case PATHINFO_DIRNAME: case 'dirname': return $ret['dirname']; break; case PATHINFO_BASENAME: case 'basename': return $ret['basename']; break; case PATHINFO_EXTENSION: case 'extension': return $ret['extension']; break; case PATHINFO_FILENAME: case 'filename': return $ret['filename']; break; default: return $ret; } } /** * Set or reset instance properties. * * Usage Example: * $page->set('X-Priority', '3'); * * @access public * @param string $name * @param mixed $value * NOTE: will not work with arrays, there are no arrays to set/reset * @throws phpmailerException * @return bool * @todo Should this not be using __set() magic function? */ public function set($name, $value = '') { try { if (isset($this->$name)) { $this->$name = $value; } else { throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL); } } catch (Exception $e) { $this->setError($e->getMessage()); if ($e->getCode() == self::STOP_CRITICAL) { return false; } } return true; } /** * Strip newlines to prevent header injection. * @access public * @param string $str * @return string */ public function secureHeader($str) { return trim(str_replace(array("\r", "\n"), '', $str)); } /** * Normalize line breaks in a string. * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. * Defaults to CRLF (for message bodies) and preserves consecutive breaks. * @param string $text * @param string $breaktype What kind of line break to use, defaults to CRLF * @return string * @access public * @static */ public static function normalizeBreaks($text, $breaktype = "\r\n") { return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text); } /** * Set the public and private key files and password for S/MIME signing. * @access public * @param string $cert_filename * @param string $key_filename * @param string $key_pass Password for private key */ public function sign($cert_filename, $key_filename, $key_pass) { $this->sign_cert_file = $cert_filename; $this->sign_key_file = $key_filename; $this->sign_key_pass = $key_pass; } /** * Quoted-Printable-encode a DKIM header. * @access public * @param string $txt * @return string */ public function DKIM_QP($txt) { $line = ''; for ($i = 0; $i < strlen($txt); $i++) { $ord = ord($txt[$i]); if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { $line .= $txt[$i]; } else { $line .= "=" . sprintf("%02X", $ord); } } return $line; } /** * Generate a DKIM signature. * @access public * @param string $s Header * @throws phpmailerException * @return string */ public function DKIM_Sign($s) { if (!defined('PKCS7_TEXT')) { if ($this->exceptions) { throw new phpmailerException($this->lang("signing") . ' OpenSSL extension missing.'); } return ''; } $privKeyStr = file_get_contents($this->DKIM_private); if ($this->DKIM_passphrase != '') { $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); } else { $privKey = $privKeyStr; } if (openssl_sign($s, $signature, $privKey)) { return base64_encode($signature); } return ''; } /** * Generate a DKIM canonicalization header. * @access public * @param string $s Header * @return string */ public function DKIM_HeaderC($s) { $s = preg_replace("/\r\n\s+/", " ", $s); $lines = explode("\r\n", $s); foreach ($lines as $key => $line) { list($heading, $value) = explode(":", $line, 2); $heading = strtolower($heading); $value = preg_replace("/\s+/", " ", $value); // Compress useless spaces $lines[$key] = $heading . ":" . trim($value); // Don't forget to remove WSP around the value } $s = implode("\r\n", $lines); return $s; } /** * Generate a DKIM canonicalization body. * @access public * @param string $body Message Body * @return string */ public function DKIM_BodyC($body) { if ($body == '') { return "\r\n"; } // stabilize line endings $body = str_replace("\r\n", "\n", $body); $body = str_replace("\n", "\r\n", $body); // END stabilize line endings while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") { $body = substr($body, 0, strlen($body) - 2); } return $body; } /** * Create the DKIM header and body in a new message header. * @access public * @param string $headers_line Header lines * @param string $subject Subject * @param string $body Body * @return string */ public function DKIM_Add($headers_line, $subject, $body) { $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body $DKIMquery = 'dns/txt'; // Query method $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) $subject_header = "Subject: $subject"; $headers = explode($this->LE, $headers_line); $from_header = ''; $to_header = ''; $current = ''; foreach ($headers as $header) { if (strpos($header, 'From:') === 0) { $from_header = $header; $current = 'from_header'; } elseif (strpos($header, 'To:') === 0) { $to_header = $header; $current = 'to_header'; } else { if ($current && strpos($header, ' =?') === 0) { $current .= $header; } else { $current = ''; } } } $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); $to = str_replace('|', '=7C', $this->DKIM_QP($to_header)); $subject = str_replace( '|', '=7C', $this->DKIM_QP($subject_header) ); // Copied header fields (dkim-quoted-printable) $body = $this->DKIM_BodyC($body); $DKIMlen = strlen($body); // Length of body $DKIMb64 = base64_encode(pack("H*", sha1($body))); // Base64 of packed binary SHA-1 hash of body $ident = ($this->DKIM_identity == '') ? '' : " i=" . $this->DKIM_identity . ";"; $dkimhdrs = "DKIM-Signature: v=1; a=" . $DKIMsignatureType . "; q=" . $DKIMquery . "; l=" . $DKIMlen . "; s=" . $this->DKIM_selector . ";\r\n" . "\tt=" . $DKIMtime . "; c=" . $DKIMcanonicalization . ";\r\n" . "\th=From:To:Subject;\r\n" . "\td=" . $this->DKIM_domain . ";" . $ident . "\r\n" . "\tz=$from\r\n" . "\t|$to\r\n" . "\t|$subject;\r\n" . "\tbh=" . $DKIMb64 . ";\r\n" . "\tb="; $toSign = $this->DKIM_HeaderC( $from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs ); $signed = $this->DKIM_Sign($toSign); return $dkimhdrs . $signed . "\r\n"; } /** * Allows for public read access to 'to' property. * @access public * @return array */ public function getToAddresses() { return $this->to; } /** * Allows for public read access to 'cc' property. * @access public * @return array */ public function getCcAddresses() { return $this->cc; } /** * Allows for public read access to 'bcc' property. * @access public * @return array */ public function getBccAddresses() { return $this->bcc; } /** * Allows for public read access to 'ReplyTo' property. * @access public * @return array */ public function getReplyToAddresses() { return $this->ReplyTo; } /** * Allows for public read access to 'all_recipients' property. * @access public * @return array */ public function getAllRecipientAddresses() { return $this->all_recipients; } /** * Perform a callback. * @param bool $isSent * @param string $to * @param string $cc * @param string $bcc * @param string $subject * @param string $body * @param string $from */ protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from = null) { if (!empty($this->action_function) && is_callable($this->action_function)) { $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from); call_user_func_array($this->action_function, $params); } } } /** * PHPMailer exception handler * @package PHPMailer */ class phpmailerException extends Exception { /** * Prettify error message output * @return string */ public function errorMessage() { $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n"; return $errorMsg; } }
01-wordpress-paypal
trunk/paypal/libraries/class.phpmailer.php
PHP
gpl3
115,456
<?php /** * PHPMailer SPL autoloader. * PHP Version 5.0.0 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ * @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2013 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ /** * PHPMailer SPL autoloader. * @param string $classname The name of the class to load */ function PHPMailerAutoload($classname) { //Can't use __DIR__ as it's only in PHP 5.3+ $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; if (is_readable($filename)) { require $filename; } } if (version_compare(PHP_VERSION, '5.1.2', '>=')) { //SPL autoloading was introduced in PHP 5.1.2 if (version_compare(PHP_VERSION, '5.3.0', '>=')) { spl_autoload_register('PHPMailerAutoload', true, true); } else { spl_autoload_register('PHPMailerAutoload'); } } else { /** * Fall back to traditional autoload for old PHP versions * @param string $classname The name of the class to load */ function __autoload($classname) { PHPMailerAutoload($classname); } }
01-wordpress-paypal
trunk/paypal/libraries/PHPMailerAutoload.php
PHP
gpl3
1,649
<?php /** * PHPMailer RFC821 SMTP email transport class. * Version 5.2.7 * PHP version 5.0.0 * @category PHP * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ * @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @copyright 2013 Marcus Bointon * @copyright 2004 - 2008 Andy Prevost * @copyright 2010 - 2012 Jim Jagielski * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) */ /** * PHPMailer RFC821 SMTP email transport class. * * Implements RFC 821 SMTP commands * and provides some utility methods for sending mail to an SMTP server. * * PHP Version 5.0.0 * * @category PHP * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/blob/master/class.smtp.php * @author Chris Ryan <unknown@example.com> * @author Marcus Bointon <phpmailer@synchromedia.co.uk> * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) */ class SMTP { /** * The PHPMailer SMTP Version number. */ const VERSION = '5.2.7'; /** * SMTP line break constant. */ const CRLF = "\r\n"; /** * The SMTP port to use if one is not specified. */ const DEFAULT_SMTP_PORT = 25; /** * The maximum line length allowed by RFC 2822 section 2.1.1 */ const MAX_LINE_LENGTH = 998; /** * The PHPMailer SMTP Version number. * @type string * @deprecated This should be a constant * @see SMTP::VERSION */ public $Version = '5.2.7'; /** * SMTP server port number. * @type int * @deprecated This is only ever ued as default value, so should be a constant * @see SMTP::DEFAULT_SMTP_PORT */ public $SMTP_PORT = 25; /** * SMTP reply line ending * @type string * @deprecated Use the class constant instead * @see SMTP::CRLF */ public $CRLF = "\r\n"; /** * Debug output level. * Options: * 0: no output * 1: commands * 2: data and commands * 3: as 2 plus connection status * 4: low level data output * @type int */ public $do_debug = 0; /** * The function/method to use for debugging output. * Options: 'echo', 'html' or 'error_log' * @type string */ public $Debugoutput = 'echo'; /** * Whether to use VERP. * @type bool */ public $do_verp = false; /** * The timeout value for connection, in seconds. * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 * @type int */ public $Timeout = 300; /** * The SMTP timelimit value for reads, in seconds. * @type int */ public $Timelimit = 30; /** * The socket for the server connection. * @type resource */ protected $smtp_conn; /** * Error message, if any, for the last call. * @type string */ protected $error = ''; /** * The reply the server sent to us for HELO. * @type string */ protected $helo_rply = ''; /** * The most recent reply received from the server. * @type string */ protected $last_reply = ''; /** * Constructor. * @access public */ public function __construct() { $this->smtp_conn = 0; $this->error = null; $this->helo_rply = null; $this->do_debug = 0; } /** * Output debugging info via a user-selected method. * @param string $str Debug string to output * @return void */ protected function edebug($str) { switch ($this->Debugoutput) { case 'error_log': //Don't output, just log error_log($str); break; case 'html': //Cleans up output a bit for a better looking, HTML-safe output echo htmlentities( preg_replace('/[\r\n]+/', '', $str), ENT_QUOTES, 'UTF-8' ) . "<br>\n"; break; case 'echo': default: echo gmdate('Y-m-d H:i:s')."\t".trim($str)."\n"; } } /** * Connect to an SMTP server. * @param string $host SMTP server IP or host name * @param int $port The port number to connect to * @param int $timeout How long to wait for the connection to open * @param array $options An array of options for stream_context_create() * @access public * @return bool */ public function connect($host, $port = null, $timeout = 30, $options = array()) { // Clear errors to avoid confusion $this->error = null; // Make sure we are __not__ connected if ($this->connected()) { // Already connected, generate error $this->error = array('error' => 'Already connected to a server'); return false; } if (empty($port)) { $port = self::DEFAULT_SMTP_PORT; } // Connect to the SMTP server if ($this->do_debug >= 3) { $this->edebug('Connection: opening'); } $errno = 0; $errstr = ''; $socket_context = stream_context_create($options); //Suppress errors; connection failures are handled at a higher level $this->smtp_conn = @stream_socket_client( $host . ":" . $port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $socket_context ); // Verify we connected properly if (empty($this->smtp_conn)) { $this->error = array( 'error' => 'Failed to connect to server', 'errno' => $errno, 'errstr' => $errstr ); if ($this->do_debug >= 1) { $this->edebug( 'SMTP ERROR: ' . $this->error['error'] . ": $errstr ($errno)" ); } return false; } if ($this->do_debug >= 3) { $this->edebug('Connection: opened'); } // SMTP server can take longer to respond, give longer timeout for first read // Windows does not have support for this timeout function if (substr(PHP_OS, 0, 3) != 'WIN') { $max = ini_get('max_execution_time'); if ($max != 0 && $timeout > $max) { // Don't bother if unlimited @set_time_limit($timeout); } stream_set_timeout($this->smtp_conn, $timeout, 0); } // Get any announcement $announce = $this->get_lines(); if ($this->do_debug >= 2) { $this->edebug('SERVER -> CLIENT: ' . $announce); } return true; } /** * Initiate a TLS (encrypted) session. * @access public * @return bool */ public function startTLS() { if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { return false; } // Begin encrypted connection if (!stream_socket_enable_crypto( $this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT )) { return false; } return true; } /** * Perform SMTP authentication. * Must be run after hello(). * @see hello() * @param string $username The user name * @param string $password The password * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5) * @param string $realm The auth realm for NTLM * @param string $workstation The auth workstation for NTLM * @access public * @return bool True if successfully authenticated. */ public function authenticate( $username, $password, $authtype = 'LOGIN', $realm = '', $workstation = '' ) { if (empty($authtype)) { $authtype = 'LOGIN'; } switch ($authtype) { case 'PLAIN': // Start authentication if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { return false; } // Send encoded username and password if (!$this->sendCommand( 'User & Password', base64_encode("\0" . $username . "\0" . $password), 235 ) ) { return false; } break; case 'LOGIN': // Start authentication if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { return false; } if (!$this->sendCommand("Username", base64_encode($username), 334)) { return false; } if (!$this->sendCommand("Password", base64_encode($password), 235)) { return false; } break; case 'NTLM': /* * ntlm_sasl_client.php * Bundled with Permission * * How to telnet in windows: * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication */ require_once 'extras/ntlm_sasl_client.php'; $temp = new stdClass(); $ntlm_client = new ntlm_sasl_client_class; //Check that functions are available if (!$ntlm_client->Initialize($temp)) { $this->error = array('error' => $temp->error); if ($this->do_debug >= 1) { $this->edebug( 'You need to enable some modules in your php.ini file: ' . $this->error['error'] ); } return false; } //msg1 $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1 if (!$this->sendCommand( 'AUTH NTLM', 'AUTH NTLM ' . base64_encode($msg1), 334 ) ) { return false; } //Though 0 based, there is a white space after the 3 digit number //msg2 $challenge = substr($this->last_reply, 3); $challenge = base64_decode($challenge); $ntlm_res = $ntlm_client->NTLMResponse( substr($challenge, 24, 8), $password ); //msg3 $msg3 = $ntlm_client->TypeMsg3( $ntlm_res, $username, $realm, $workstation ); // send encoded username return $this->sendCommand('Username', base64_encode($msg3), 235); break; case 'CRAM-MD5': // Start authentication if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { return false; } // Get the challenge $challenge = base64_decode(substr($this->last_reply, 4)); // Build the response $response = $username . ' ' . $this->hmac($challenge, $password); // send encoded credentials return $this->sendCommand('Username', base64_encode($response), 235); break; } return true; } /** * Calculate an MD5 HMAC hash. * Works like hash_hmac('md5', $data, $key) * in case that function is not available * @param string $data The data to hash * @param string $key The key to hash with * @access protected * @return string */ protected function hmac($data, $key) { if (function_exists('hash_hmac')) { return hash_hmac('md5', $data, $key); } // The following borrowed from // http://php.net/manual/en/function.mhash.php#27225 // RFC 2104 HMAC implementation for php. // Creates an md5 HMAC. // Eliminates the need to install mhash to compute a HMAC // Hacked by Lance Rushing $b = 64; // byte length for md5 if (strlen($key) > $b) { $key = pack('H*', md5($key)); } $key = str_pad($key, $b, chr(0x00)); $ipad = str_pad('', $b, chr(0x36)); $opad = str_pad('', $b, chr(0x5c)); $k_ipad = $key ^ $ipad; $k_opad = $key ^ $opad; return md5($k_opad . pack('H*', md5($k_ipad . $data))); } /** * Check connection state. * @access public * @return bool True if connected. */ public function connected() { if (!empty($this->smtp_conn)) { $sock_status = stream_get_meta_data($this->smtp_conn); if ($sock_status['eof']) { // the socket is valid but we are not connected if ($this->do_debug >= 1) { $this->edebug( 'SMTP NOTICE: EOF caught while checking if connected' ); } $this->close(); return false; } return true; // everything looks good } return false; } /** * Close the socket and clean up the state of the class. * Don't use this function without first trying to use QUIT. * @see quit() * @access public * @return void */ public function close() { $this->error = null; // so there is no confusion $this->helo_rply = null; if (!empty($this->smtp_conn)) { // close the connection and cleanup fclose($this->smtp_conn); if ($this->do_debug >= 3) { $this->edebug('Connection: closed'); } $this->smtp_conn = 0; } } /** * Send an SMTP DATA command. * Issues a data command and sends the msg_data to the server, * finializing the mail transaction. $msg_data is the message * that is to be send with the headers. Each header needs to be * on a single line followed by a <CRLF> with the message headers * and the message body being separated by and additional <CRLF>. * Implements rfc 821: DATA <CRLF> * @param string $msg_data Message data to send * @access public * @return bool */ public function data($msg_data) { if (!$this->sendCommand('DATA', 'DATA', 354)) { return false; } /* The server is ready to accept data! * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF) * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into * smaller lines to fit within the limit. * We will also look for lines that start with a '.' and prepend an additional '.'. * NOTE: this does not count towards line-length limit. */ // Normalize line breaks before exploding $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data)); /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field * of the first line (':' separated) does not contain a space then it _should_ be a header and we will * process all lines before a blank line as headers. */ $field = substr($lines[0], 0, strpos($lines[0], ':')); $in_headers = false; if (!empty($field) && strpos($field, ' ') === false) { $in_headers = true; } foreach ($lines as $line) { $lines_out = array(); if ($in_headers and $line == '') { $in_headers = false; } // ok we need to break this line up into several smaller lines //This is a small micro-optimisation: isset($str[$len]) is equivalent to (strlen($str) > $len) while (isset($line[self::MAX_LINE_LENGTH])) { //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on //so as to avoid breaking in the middle of a word $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); if (!$pos) { //Deliberately matches both false and 0 //No nice break found, add a hard break $pos = self::MAX_LINE_LENGTH - 1; $lines_out[] = substr($line, 0, $pos); $line = substr($line, $pos); } else { //Break at the found point $lines_out[] = substr($line, 0, $pos); //Move along by the amount we dealt with $line = substr($line, $pos + 1); } /* If processing headers add a LWSP-char to the front of new line * RFC822 section 3.1.1 */ if ($in_headers) { $line = "\t" . $line; } } $lines_out[] = $line; // Send the lines to the server foreach ($lines_out as $line_out) { //RFC2821 section 4.5.2 if (!empty($line_out) and $line_out[0] == '.') { $line_out = '.' . $line_out; } $this->client_send($line_out . self::CRLF); } } // Message data has been sent, complete the command return $this->sendCommand('DATA END', '.', 250); } /** * Send an SMTP HELO or EHLO command. * Used to identify the sending server to the receiving server. * This makes sure that client and server are in a known state. * Implements RFC 821: HELO <SP> <domain> <CRLF> * and RFC 2821 EHLO. * @param string $host The host name or IP to connect to * @access public * @return bool */ public function hello($host = '') { // Try extended hello first (RFC 2821) return (bool)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); } /** * Send an SMTP HELO or EHLO command. * Low-level implementation used by hello() * @see hello() * @param string $hello The HELO string * @param string $host The hostname to say we are * @access protected * @return bool */ protected function sendHello($hello, $host) { $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); $this->helo_rply = $this->last_reply; return $noerror; } /** * Send an SMTP MAIL command. * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more recipient * commands may be called followed by a data command. * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF> * @param string $from Source address of this message * @access public * @return bool */ public function mail($from) { $useVerp = ($this->do_verp ? ' XVERP' : ''); return $this->sendCommand( 'MAIL FROM', 'MAIL FROM:<' . $from . '>' . $useVerp, 250 ); } /** * Send an SMTP QUIT command. * Closes the socket if there is no error or the $close_on_error argument is true. * Implements from rfc 821: QUIT <CRLF> * @param bool $close_on_error Should the connection close if an error occurs? * @access public * @return bool */ public function quit($close_on_error = true) { $noerror = $this->sendCommand('QUIT', 'QUIT', 221); $e = $this->error; //Save any error if ($noerror or $close_on_error) { $this->close(); $this->error = $e; //Restore any error from the quit command } return $noerror; } /** * Send an SMTP RCPT command. * Sets the TO argument to $to. * Returns true if the recipient was accepted false if it was rejected. * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF> * @param string $to The address the message is being sent to * @access public * @return bool */ public function recipient($to) { return $this->sendCommand( 'RCPT TO', 'RCPT TO:<' . $to . '>', array(250, 251) ); } /** * Send an SMTP RSET command. * Abort any transaction that is currently in progress. * Implements rfc 821: RSET <CRLF> * @access public * @return bool True on success. */ public function reset() { return $this->sendCommand('RSET', 'RSET', 250); } /** * Send a command to an SMTP server and check its return code. * @param string $command The command name - not sent to the server * @param string $commandstring The actual command to send * @param int|array $expect One or more expected integer success codes * @access protected * @return bool True on success. */ protected function sendCommand($command, $commandstring, $expect) { if (!$this->connected()) { $this->error = array( 'error' => "Called $command without being connected" ); return false; } $this->client_send($commandstring . self::CRLF); $reply = $this->get_lines(); $code = substr($reply, 0, 3); if ($this->do_debug >= 2) { $this->edebug('SERVER -> CLIENT: ' . $reply); } if (!in_array($code, (array)$expect)) { $this->last_reply = null; $this->error = array( 'error' => "$command command failed", 'smtp_code' => $code, 'detail' => substr($reply, 4) ); if ($this->do_debug >= 1) { $this->edebug( 'SMTP ERROR: ' . $this->error['error'] . ': ' . $reply ); } return false; } $this->last_reply = $reply; $this->error = null; return true; } /** * Send an SMTP SAML command. * Starts a mail transaction from the email address specified in $from. * Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more recipient * commands may be called followed by a data command. This command * will send the message to the users terminal if they are logged * in and send them an email. * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF> * @param string $from The address the message is from * @access public * @return bool */ public function sendAndMail($from) { return $this->sendCommand('SAML', "SAML FROM:$from", 250); } /** * Send an SMTP VRFY command. * @param string $name The name to verify * @access public * @return bool */ public function verify($name) { return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); } /** * Send an SMTP NOOP command. * Used to keep keep-alives alive, doesn't actually do anything * @access public * @return bool */ public function noop() { return $this->sendCommand('NOOP', 'NOOP', 250); } /** * Send an SMTP TURN command. * This is an optional command for SMTP that this class does not support. * This method is here to make the RFC821 Definition complete for this class * and _may_ be implemented in future * Implements from rfc 821: TURN <CRLF> * @access public * @return bool */ public function turn() { $this->error = array( 'error' => 'The SMTP TURN command is not implemented' ); if ($this->do_debug >= 1) { $this->edebug('SMTP NOTICE: ' . $this->error['error']); } return false; } /** * Send raw data to the server. * @param string $data The data to send * @access public * @return int|bool The number of bytes sent to the server or false on error */ public function client_send($data) { if ($this->do_debug >= 1) { $this->edebug("CLIENT -> SERVER: $data"); } return fwrite($this->smtp_conn, $data); } /** * Get the latest error. * @access public * @return array */ public function getError() { return $this->error; } /** * Get the last reply from the server. * @access public * @return string */ public function getLastReply() { return $this->last_reply; } /** * Read the SMTP server's response. * Either before eof or socket timeout occurs on the operation. * With SMTP we can tell if we have more lines to read if the * 4th character is '-' symbol. If it is a space then we don't * need to read anything else. * @access protected * @return string */ protected function get_lines() { // If the connection is bad, give up straight away if (!is_resource($this->smtp_conn)) { return ''; } $data = ''; $endtime = 0; stream_set_timeout($this->smtp_conn, $this->Timeout); if ($this->Timelimit > 0) { $endtime = time() + $this->Timelimit; } while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { $str = @fgets($this->smtp_conn, 515); if ($this->do_debug >= 4) { $this->edebug("SMTP -> get_lines(): \$data was \"$data\""); $this->edebug("SMTP -> get_lines(): \$str is \"$str\""); } $data .= $str; if ($this->do_debug >= 4) { $this->edebug("SMTP -> get_lines(): \$data is \"$data\""); } // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen if ((isset($str[3]) and $str[3] == ' ')) { break; } // Timed-out? Log and break $info = stream_get_meta_data($this->smtp_conn); if ($info['timed_out']) { if ($this->do_debug >= 4) { $this->edebug( 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)' ); } break; } // Now check if reads took too long if ($endtime and time() > $endtime) { if ($this->do_debug >= 4) { $this->edebug( 'SMTP -> get_lines(): timelimit reached ('. $this->Timelimit . ' sec)' ); } break; } } return $data; } /** * Enable or disable VERP address generation. * @param bool $enabled */ public function setVerp($enabled = false) { $this->do_verp = $enabled; } /** * Get VERP address generation mode. * @return bool */ public function getVerp() { return $this->do_verp; } /** * Set debug output method. * @param string $method The function/method to use for debugging output. */ public function setDebugOutput($method = 'echo') { $this->Debugoutput = $method; } /** * Get debug output method. * @return string */ public function getDebugOutput() { return $this->Debugoutput; } /** * Set debug output level. * @param int $level */ public function setDebugLevel($level = 0) { $this->do_debug = $level; } /** * Get debug output level. * @return int */ public function getDebugLevel() { return $this->do_debug; } /** * Set SMTP timeout. * @param int $timeout */ public function setTimeout($timeout = 0) { $this->Timeout = $timeout; } /** * Get SMTP timeout. * @return int */ public function getTimeout() { return $this->Timeout; } }
01-wordpress-paypal
trunk/paypal/libraries/class.smtp.php
PHP
gpl3
29,074
<?php /** * PHPMailer POP-Before-SMTP Authentication Class. * PHP Version 5.0.0 * Version 5.2.7 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ * @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2013 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ /** * PHPMailer POP-Before-SMTP Authentication Class. * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. * Does not support APOP. * @package PHPMailer * @author Richard Davey (original author) <rich@corephp.co.uk> * @author Marcus Bointon (coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> */ class POP3 { /** * The POP3 PHPMailer Version number. * @type string * @access public */ public $Version = '5.2.7'; /** * Default POP3 port number. * @type int * @access public */ public $POP3_PORT = 110; /** * Default timeout in seconds. * @type int * @access public */ public $POP3_TIMEOUT = 30; /** * POP3 Carriage Return + Line Feed. * @type string * @access public * @deprecated Use the constant instead */ public $CRLF = "\r\n"; /** * Debug display level. * Options: 0 = no, 1+ = yes * @type int * @access public */ public $do_debug = 0; /** * POP3 mail server hostname. * @type string * @access public */ public $host; /** * POP3 port number. * @type int * @access public */ public $port; /** * POP3 Timeout Value in seconds. * @type int * @access public */ public $tval; /** * POP3 username * @type string * @access public */ public $username; /** * POP3 password. * @type string * @access public */ public $password; /** * Resource handle for the POP3 connection socket. * @type resource * @access private */ private $pop_conn; /** * Are we connected? * @type bool * @access private */ private $connected; /** * Error container. * @type array * @access private */ private $error; /** * Line break constant */ const CRLF = "\r\n"; /** * Constructor. * @access public */ public function __construct() { $this->pop_conn = 0; $this->connected = false; $this->error = null; } /** * Simple static wrapper for all-in-one POP before SMTP * @param $host * @param bool $port * @param bool $tval * @param string $username * @param string $password * @param int $debug_level * @return bool */ public static function popBeforeSmtp( $host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0 ) { $pop = new POP3; return $pop->authorise($host, $port, $tval, $username, $password, $debug_level); } /** * Authenticate with a POP3 server. * A connect, login, disconnect sequence * appropriate for POP-before SMTP authorisation. * @access public * @param string $host * @param bool|int $port * @param bool|int $tval * @param string $username * @param string $password * @param int $debug_level * @return bool */ public function authorise($host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0) { $this->host = $host; // If no port value provided, use default if ($port === false) { $this->port = $this->POP3_PORT; } else { $this->port = $port; } // If no timeout value provided, use default if ($tval === false) { $this->tval = $this->POP3_TIMEOUT; } else { $this->tval = $tval; } $this->do_debug = $debug_level; $this->username = $username; $this->password = $password; // Refresh the error log $this->error = null; // connect $result = $this->connect($this->host, $this->port, $this->tval); if ($result) { $login_result = $this->login($this->username, $this->password); if ($login_result) { $this->disconnect(); return true; } } // We need to disconnect regardless of whether the login succeeded $this->disconnect(); return false; } /** * Connect to a POP3 server. * @access public * @param string $host * @param bool|int $port * @param integer $tval * @return boolean */ public function connect($host, $port = false, $tval = 30) { // Are we already connected? if ($this->connected) { return true; } //On Windows this will raise a PHP Warning error if the hostname doesn't exist. //Rather than suppress it with @fsockopen, capture it cleanly instead set_error_handler(array($this, 'catchWarning')); // connect to the POP3 server $this->pop_conn = fsockopen( $host, // POP3 Host $port, // Port # $errno, // Error Number $errstr, // Error Message $tval ); // Timeout (seconds) // Restore the error handler restore_error_handler(); // Does the Error Log now contain anything? if ($this->error && $this->do_debug >= 1) { $this->displayErrors(); } // Did we connect? if ($this->pop_conn == false) { // It would appear not... $this->error = array( 'error' => "Failed to connect to server $host on port $port", 'errno' => $errno, 'errstr' => $errstr ); if ($this->do_debug >= 1) { $this->displayErrors(); } return false; } // Increase the stream time-out // Check for PHP 4.3.0 or later if (version_compare(phpversion(), '5.0.0', 'ge')) { stream_set_timeout($this->pop_conn, $tval, 0); } else { // Does not work on Windows if (substr(PHP_OS, 0, 3) !== 'WIN') { socket_set_timeout($this->pop_conn, $tval, 0); } } // Get the POP3 server response $pop3_response = $this->getResponse(); // Check for the +OK if ($this->checkResponse($pop3_response)) { // The connection is established and the POP3 server is talking $this->connected = true; return true; } return false; } /** * Log in to the POP3 server. * Does not support APOP (RFC 2828, 4949). * @access public * @param string $username * @param string $password * @return boolean */ public function login($username = '', $password = '') { if ($this->connected == false) { $this->error = 'Not connected to POP3 server'; if ($this->do_debug >= 1) { $this->displayErrors(); } } if (empty($username)) { $username = $this->username; } if (empty($password)) { $password = $this->password; } // Send the Username $this->sendString("USER $username" . self::CRLF); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { // Send the Password $this->sendString("PASS $password" . self::CRLF); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { return true; } } return false; } /** * Disconnect from the POP3 server. * @access public */ public function disconnect() { $this->sendString('QUIT'); //The QUIT command may cause the daemon to exit, which will kill our connection //So ignore errors here @fclose($this->pop_conn); } /** * Get a response from the POP3 server. * $size is the maximum number of bytes to retrieve * @param integer $size * @return string * @access private */ private function getResponse($size = 128) { $r = fgets($this->pop_conn, $size); if ($this->do_debug >= 1) { echo "Server -> Client: $r"; } return $r; } /** * Send raw data to the POP3 server. * @param string $string * @return integer * @access private */ private function sendString($string) { if ($this->pop_conn) { if ($this->do_debug >= 2) { //Show client messages when debug >= 2 echo "Client -> Server: $string"; } return fwrite($this->pop_conn, $string, strlen($string)); } return 0; } /** * Checks the POP3 server response. * Looks for for +OK or -ERR. * @param string $string * @return boolean * @access private */ private function checkResponse($string) { if (substr($string, 0, 3) !== '+OK') { $this->error = array( 'error' => "Server reported an error: $string", 'errno' => 0, 'errstr' => '' ); if ($this->do_debug >= 1) { $this->displayErrors(); } return false; } else { return true; } } /** * Display errors if debug is enabled. * @access private */ private function displayErrors() { echo '<pre>'; foreach ($this->error as $single_error) { print_r($single_error); } echo '</pre>'; } /** * POP3 connection error handler. * @param integer $errno * @param string $errstr * @param string $errfile * @param integer $errline * @access private */ private function catchWarning($errno, $errstr, $errfile, $errline) { $this->error[] = array( 'error' => "Connecting to the POP3 server raised a PHP warning: ", 'errno' => $errno, 'errstr' => $errstr, 'errfile' => $errfile, 'errline' => $errline ); } }
01-wordpress-paypal
trunk/paypal/libraries/class.pop3.php
PHP
gpl3
11,141
<?php /** * WordPress User Page * * Handles authentication, registering, resetting passwords, forgot password, * and other user handling. * * @package WordPress */ /** Make sure that the WordPress bootstrap has run before continuing. */ require( dirname(__FILE__) . '/wp-load.php' ); // Redirect to https login if forced to use SSL if ( force_ssl_admin() && ! is_ssl() ) { if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); exit(); } else { wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); exit(); } } /** * Output the login page header. * * @param string $title Optional. WordPress Log In Page title to display in <title/> element. Default 'Log In'. * @param string $message Optional. Message to display in header. Default empty. * @param string $wp_error Optional. The error to pass. Default empty. * @param WP_Error $wp_error Optional. WordPress Error Object */ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { global $error, $interim_login, $action; // Don't index any of these forms add_action( 'login_head', 'wp_no_robots' ); if ( wp_is_mobile() ) add_action( 'login_head', 'wp_login_viewport_meta' ); if ( empty($wp_error) ) $wp_error = new WP_Error(); // Shake it! $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' ); /** * Filter the error codes array for shaking the login form. * * @since 3.0.0 * * @param array $shake_error_codes Error codes that shake the login form. */ $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) add_action( 'login_head', 'wp_shake_js', 12 ); ?><!DOCTYPE html> <!--[if IE 8]> <html xmlns="http://www.w3.org/1999/xhtml" class="ie8" <?php language_attributes(); ?>> <![endif]--> <!--[if !(IE 8) ]><!--> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <!--<![endif]--> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title> <?php wp_admin_css( 'login', true ); // Remove all stored post data on logging out. // This could be added by add_action('login_head'...) like wp_shake_js() // but maybe better if it's not removable by plugins if ( 'loggedout' == $wp_error->get_error_code() ) { ?> <script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script> <?php } /** * Enqueue scripts and styles for the login page. * * @since 3.1.0 */ do_action( 'login_enqueue_scripts' ); /** * Fires in the login page header after scripts are enqueued. * * @since 2.1.0 */ do_action( 'login_head' ); if ( is_multisite() ) { $login_header_url = network_home_url(); $login_header_title = get_current_site()->site_name; } else { $login_header_url = __( 'https://wordpress.org/' ); $login_header_title = __( 'Powered by WordPress' ); } /** * Filter link URL of the header logo above login form. * * @since 2.1.0 * * @param string $login_header_url Login header logo URL. */ $login_header_url = apply_filters( 'login_headerurl', $login_header_url ); /** * Filter the title attribute of the header logo above login form. * * @since 2.1.0 * * @param string $login_header_title Login header logo title attribute. */ $login_header_title = apply_filters( 'login_headertitle', $login_header_title ); $classes = array( 'login-action-' . $action, 'wp-core-ui' ); if ( wp_is_mobile() ) $classes[] = 'mobile'; if ( is_rtl() ) $classes[] = 'rtl'; if ( $interim_login ) { $classes[] = 'interim-login'; ?> <style type="text/css">html{background-color: transparent;}</style> <?php if ( 'success' === $interim_login ) $classes[] = 'interim-login-success'; } $classes[] =' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); /** * Filter the login page body classes. * * @since 3.5.0 * * @param array $classes An array of body classes. * @param string $action The action that brought the visitor to the login page. */ $classes = apply_filters( 'login_body_class', $classes, $action ); ?> </head> <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>"> <div id="login"> <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1> <?php unset( $login_header_url, $login_header_title ); /** * Filter the message to display above the login form. * * @since 2.1.0 * * @param string $message Login message text. */ $message = apply_filters( 'login_message', $message ); if ( !empty( $message ) ) echo $message . "\n"; // In case a plugin uses $error rather than the $wp_errors object if ( !empty( $error ) ) { $wp_error->add('error', $error); unset($error); } if ( $wp_error->get_error_code() ) { $errors = ''; $messages = ''; foreach ( $wp_error->get_error_codes() as $code ) { $severity = $wp_error->get_error_data($code); foreach ( $wp_error->get_error_messages($code) as $error ) { if ( 'message' == $severity ) $messages .= ' ' . $error . "<br />\n"; else $errors .= ' ' . $error . "<br />\n"; } } if ( ! empty( $errors ) ) { /** * Filter the error messages displayed above the login form. * * @since 2.1.0 * * @param string $errors Login error message. */ echo '<div id="login_error">' . apply_filters( 'login_errors', $errors ) . "</div>\n"; } if ( ! empty( $messages ) ) { /** * Filter instructional messages displayed above the login form. * * @since 2.5.0 * * @param string $messages Login messages. */ echo '<p class="message">' . apply_filters( 'login_messages', $messages ) . "</p>\n"; } } } // End of login_header() /** * Outputs the footer for the login page. * * @param string $input_id Which input to auto-focus */ function login_footer($input_id = '') { global $interim_login; // Don't allow interim logins to navigate away from the page. if ( ! $interim_login ): ?> <p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php esc_attr_e( 'Are you lost?' ); ?>"><?php printf( __( '&larr; Back to %s' ), get_bloginfo( 'title', 'display' ) ); ?></a></p> <?php endif; ?> </div> <?php if ( !empty($input_id) ) : ?> <script type="text/javascript"> try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){} if(typeof wpOnload=='function')wpOnload(); </script> <?php endif; ?> <?php /** * Fires in the login page footer. * * @since 3.1.0 */ do_action( 'login_footer' ); ?> <div class="clear"></div> </body> </html> <?php } function wp_shake_js() { if ( wp_is_mobile() ) return; ?> <script type="text/javascript"> addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; function s(id,pos){g(id).left=pos+'px';} function g(id){return document.getElementById(id).style;} function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}} addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);}); </script> <?php } function wp_login_viewport_meta() { ?> <meta name="viewport" content="width=device-width" /> <?php } /** * Handles sending password retrieval email to user. * * @uses $wpdb WordPress Database object * * @return bool|WP_Error True: when finish. WP_Error on error */ function retrieve_password() { global $wpdb, $wp_hasher; $errors = new WP_Error(); if ( empty( $_POST['user_login'] ) ) { $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.')); } else if ( strpos( $_POST['user_login'], '@' ) ) { $user_data = get_user_by( 'email', trim( $_POST['user_login'] ) ); if ( empty( $user_data ) ) $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.')); } else { $login = trim($_POST['user_login']); $user_data = get_user_by('login', $login); } /** * Fires before errors are returned from a password reset request. * * @since 2.1.0 */ do_action( 'lostpassword_post' ); if ( $errors->get_error_code() ) return $errors; if ( !$user_data ) { $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.')); return $errors; } // redefining user_login ensures we return the right case in the email $user_login = $user_data->user_login; $user_email = $user_data->user_email; /** * Fires before a new password is retrieved. * * @since 1.5.0 * @deprecated 1.5.1 Misspelled. Use 'retrieve_password' hook instead. * * @param string $user_login The user login name. */ do_action( 'retreive_password', $user_login ); /** * Fires before a new password is retrieved. * * @since 1.5.1 * * @param string $user_login The user login name. */ do_action( 'retrieve_password', $user_login ); /** * Filter whether to allow a password to be reset. * * @since 2.7.0 * * @param bool true Whether to allow the password to be reset. Default true. * @param int $user_data->ID The ID of the user attempting to reset a password. */ $allow = apply_filters( 'allow_password_reset', true, $user_data->ID ); if ( ! $allow ) return new WP_Error('no_password_reset', __('Password reset is not allowed for this user')); else if ( is_wp_error($allow) ) return $allow; // Generate something random for a password reset key. $key = wp_generate_password( 20, false ); /** * Fires when a password reset key is generated. * * @since 2.5.0 * * @param string $user_login The username for the user. * @param string $key The generated password reset key. */ do_action( 'retrieve_password_key', $user_login, $key ); // Now insert the key, hashed, into the DB. if ( empty( $wp_hasher ) ) { require_once ABSPATH . 'wp-includes/class-phpass.php'; $wp_hasher = new PasswordHash( 8, true ); } $hashed = $wp_hasher->HashPassword( $key ); $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user_login ) ); $message = __('Someone requested that the password be reset for the following account:') . "\r\n\r\n"; $message .= network_home_url( '/' ) . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n"; $message .= __('To reset your password, visit the following address:') . "\r\n\r\n"; $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; if ( is_multisite() ) $blogname = $GLOBALS['current_site']->site_name; else // The blogname option is escaped with esc_html on the way into the database in sanitize_option // we want to reverse this for the plain text arena of emails. $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); $title = sprintf( __('[%s] Password Reset'), $blogname ); /** * Filter the subject of the password reset email. * * @since 2.8.0 * * @param string $title Default email title. */ $title = apply_filters( 'retrieve_password_title', $title ); /** * Filter the message body of the password reset mail. * * @since 2.8.0 * * @param string $message Default mail message. * @param string $key The activation key. */ $message = apply_filters( 'retrieve_password_message', $message, $key ); if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') ); return true; } // // Main // $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login'; $errors = new WP_Error(); if ( isset($_GET['key']) ) $action = 'resetpass'; // validate action so as to default to the login screen if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) ) $action = 'login'; nocache_headers(); header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset')); if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) ); if ( $url != get_option( 'siteurl' ) ) update_option( 'siteurl', $url ); } //Set a cookie now to see if they are supported by the browser. setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); if ( SITECOOKIEPATH != COOKIEPATH ) setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); /** * Fires when the login form is initialized. * * @since 3.2.0 */ do_action( 'login_init' ); /** * Fires before a specified login form action. * * The dynamic portion of the hook name, $action, refers to the action * that brought the visitor to the login form. Actions include 'postpass', * 'logout', 'lostpassword', etc. * * @since 2.8.0 */ do_action( 'login_form_' . $action ); $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); $interim_login = isset($_REQUEST['interim-login']); switch ($action) { case 'postpass' : require_once ABSPATH . 'wp-includes/class-phpass.php'; $hasher = new PasswordHash( 8, true ); /** * Filter the life span of the post password cookie. * * By default, the cookie expires 10 days from creation. To turn this * into a session cookie, return 0. * * @since 3.7.0 * * @param int $expires The expiry time, as passed to setcookie(). */ $expire = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS ); setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH ); wp_safe_redirect( wp_get_referer() ); exit(); break; case 'logout' : check_admin_referer('log-out'); wp_logout(); $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true'; wp_safe_redirect( $redirect_to ); exit(); break; case 'lostpassword' : case 'retrievepassword' : if ( $http_post ) { $errors = retrieve_password(); if ( !is_wp_error($errors) ) { $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm'; wp_safe_redirect( $redirect_to ); exit(); } } if ( isset( $_GET['error'] ) ) { if ( 'invalidkey' == $_GET['error'] ) $errors->add( 'invalidkey', __( 'Sorry, that key does not appear to be valid.' ) ); elseif ( 'expiredkey' == $_GET['error'] ) $errors->add( 'expiredkey', __( 'Sorry, that key has expired. Please try again.' ) ); } $lostpassword_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; /** * Filter the URL redirected to after submitting the lostpassword/retrievepassword form. * * @since 3.0.0 * * @param string $lostpassword_redirect The redirect destination URL. */ $redirect_to = apply_filters( 'lostpassword_redirect', $lostpassword_redirect ); /** * Fires before the lost password form. * * @since 1.5.1 */ do_action( 'lost_password' ); login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '</p>', $errors); $user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : ''; ?> <form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post"> <p> <label for="user_login" ><?php _e('Username or E-mail:') ?><br /> <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label> </p> <?php /** * Fires inside the lostpassword <form> tags, before the hidden fields. * * @since 2.1.0 */ do_action( 'lostpassword_form' ); ?> <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" /> <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Get New Password'); ?>" /></p> </form> <p id="nav"> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in') ?></a> <?php if ( get_option( 'users_can_register' ) ) : $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); /** * Filter the registration URL below the login form. * * @since 1.5.0 * * @param string $registration_url Registration URL. */ echo ' | ' . apply_filters( 'register', $registration_url ); endif; ?> </p> <?php login_footer('user_login'); break; case 'resetpass' : case 'rp' : $user = check_password_reset_key($_GET['key'], $_GET['login']); if ( is_wp_error($user) ) { if ( $user->get_error_code() === 'expired_key' ) wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) ); else wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) ); exit; } $errors = new WP_Error(); if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] ) $errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) ); /** * Fires before the password reset procedure is validated. * * @since 3.5.0 * * @param object $errors WP Error object. * @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise. */ do_action( 'validate_password_reset', $errors, $user ); if ( ( ! $errors->get_error_code() ) && isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) { reset_password($user, $_POST['pass1']); login_header( __( 'Password Reset' ), '<p class="message reset-pass">' . __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a></p>' ); login_footer(); exit; } wp_enqueue_script('utils'); wp_enqueue_script('user-profile'); login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Enter your new password below.') . '</p>', $errors ); ?> <form name="resetpassform" id="resetpassform" action="<?php echo esc_url( site_url( 'wp-login.php?action=resetpass&key=' . urlencode( $_GET['key'] ) . '&login=' . urlencode( $_GET['login'] ), 'login_post' ) ); ?>" method="post" autocomplete="off"> <input type="hidden" id="user_login" value="<?php echo esc_attr( $_GET['login'] ); ?>" autocomplete="off" /> <p> <label for="pass1"><?php _e('New password') ?><br /> <input type="password" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" /></label> </p> <p> <label for="pass2"><?php _e('Confirm new password') ?><br /> <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" /></label> </p> <div id="pass-strength-result" class="hide-if-no-js"><?php _e('Strength indicator'); ?></div> <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ &amp; ).'); ?></p> <br class="clear" /> <?php /** * Fires following the 'Strength indicator' meter in the user password reset form. * * @since 3.9.0 * * @param WP_User $user User object of the user whose password is being reset. */ do_action( 'resetpass_form', $user ); ?> <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Reset Password'); ?>" /></p> </form> <p id="nav"> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> <?php if ( get_option( 'users_can_register' ) ) : $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); /** This filter is documented in wp-login.php */ echo ' | ' . apply_filters( 'register', $registration_url ); endif; ?> </p> <?php login_footer('user_pass'); break; case 'register' : if ( is_multisite() ) { $sign_up_url = network_site_url( 'wp-signup.php' ); /** * Filter the Multisite sign up URL. * * @since 3.0.0 * * @param string $sign_up_url The sign up URL. */ wp_redirect( apply_filters( 'wp_signup_location', $sign_up_url ) ); exit; } if ( !get_option('users_can_register') ) { wp_redirect( site_url('wp-login.php?registration=disabled') ); exit(); } $user_login = ''; $user_email = ''; if ( $http_post ) { $user_login = $_POST['user_login']; $user_email = $_POST['user_email']; $errors = register_new_user($user_login, $user_email); if ( !is_wp_error($errors) ) { $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered'; wp_safe_redirect( $redirect_to ); exit(); } } $registration_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; /** * Filter the registration redirect URL. * * @since 3.0.0 * * @param string $registration_redirect The redirect destination URL. */ $redirect_to = apply_filters( 'registration_redirect', $registration_redirect ); login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors); ?> <form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post"> <p> <label for="user_login"><?php _e('Username') ?><br /> <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label> </p> <p> <label for="user_email"><?php _e('E-mail') ?><br /> <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label> </p> <?php /** * Fires following the 'E-mail' field in the user registration form. * * @since 2.1.0 */ do_action( 'register_form' ); ?> <p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p> <br class="clear" /> <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" /> <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Register'); ?>" /></p> </form> <p id="nav"> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> | <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ) ?>"><?php _e( 'Lost your password?' ); ?></a> </p> <?php login_footer('user_login'); break; case 'login' : default: $secure_cookie = ''; $customize_login = isset( $_REQUEST['customize-login'] ); if ( $customize_login ) wp_enqueue_script( 'customize-base' ); // If the user wants ssl but the session is not ssl, force a secure cookie. if ( !empty($_POST['log']) && !force_ssl_admin() ) { $user_name = sanitize_user($_POST['log']); if ( $user = get_user_by('login', $user_name) ) { if ( get_user_option('use_ssl', $user->ID) ) { $secure_cookie = true; force_ssl_admin(true); } } } if ( isset( $_REQUEST['redirect_to'] ) ) { $redirect_to = $_REQUEST['redirect_to']; // Redirect to https if user wants ssl if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') ) $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); } else { $redirect_to = admin_url(); } $reauth = empty($_REQUEST['reauth']) ? false : true; // If the user was redirected to a secure login form from a non-secure admin page, and secure login is required but secure admin is not, then don't use a secure // cookie and redirect back to the referring non-secure admin page. This allows logins to always be POSTed over SSL while allowing the user to choose visiting // the admin via http or https. if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) ) $secure_cookie = false; $user = wp_signon( '', $secure_cookie ); if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) { if ( headers_sent() ) { $user = new WP_Error( 'test_cookie', sprintf( __( '<strong>ERROR</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ), __( 'http://codex.wordpress.org/Cookies' ), __( 'https://wordpress.org/support/' ) ) ); } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) { // If cookies are disabled we can't log in even with a valid user+pass $user = new WP_Error( 'test_cookie', sprintf( __( '<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ), __( 'http://codex.wordpress.org/Cookies' ) ) ); } } $requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; /** * Filter the login redirect URL. * * @since 3.0.0 * * @param string $redirect_to The redirect destination URL. * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise. */ $redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user ); if ( !is_wp_error($user) && !$reauth ) { if ( $interim_login ) { $message = '<p class="message">' . __('You have logged in successfully.') . '</p>'; $interim_login = 'success'; login_header( '', $message ); ?> </div> <?php /** This action is documented in wp-login.php */ do_action( 'login_footer' ); ?> <?php if ( $customize_login ) : ?> <script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script> <?php endif; ?> </body></html> <?php exit; } if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) ) $redirect_to = user_admin_url(); elseif ( is_multisite() && !$user->has_cap('read') ) $redirect_to = get_dashboard_url( $user->ID ); elseif ( !$user->has_cap('edit_posts') ) $redirect_to = admin_url('profile.php'); } wp_safe_redirect($redirect_to); exit(); } $errors = $user; // Clear errors if loggedout is set. if ( !empty($_GET['loggedout']) || $reauth ) $errors = new WP_Error(); if ( $interim_login ) { if ( ! $errors->get_error_code() ) $errors->add('expired', __('Session expired. Please log in again. You will not move away from this page.'), 'message'); } else { // Some parts of this script use the main login form to display a message if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] ) $errors->add('loggedout', __('You are now logged out.'), 'message'); elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $errors->add('registerdisabled', __('User registration is currently not allowed.')); elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); elseif ( strpos( $redirect_to, 'about.php?updated' ) ) $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' ); } /** * Filter the login page errors. * * @since 3.6.0 * * @param object $errors WP Error object. * @param string $redirect_to Redirect destination URL. */ $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to ); // Clear any stale cookies. if ( $reauth ) wp_clear_auth_cookie(); login_header(__('Log In'), '', $errors); if ( isset($_POST['log']) ) $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : ''; $rememberme = ! empty( $_POST['rememberme'] ); ?> <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post"> <p> <label for="user_login"><?php _e('Username') ?><br /> <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label> </p> <p> <label for="user_pass"><?php _e('Password') ?><br /> <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label> </p> <?php /** * Fires following the 'Password' field in the login form. * * @since 2.1.0 */ do_action( 'login_form' ); ?> <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /> <?php esc_attr_e('Remember Me'); ?></label></p> <p class="submit"> <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Log In'); ?>" /> <?php if ( $interim_login ) { ?> <input type="hidden" name="interim-login" value="1" /> <?php } else { ?> <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" /> <?php } ?> <?php if ( $customize_login ) : ?> <input type="hidden" name="customize-login" value="1" /> <?php endif; ?> <input type="hidden" name="testcookie" value="1" /> </p> </form> <?php if ( ! $interim_login ) { ?> <p id="nav"> <?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : if ( get_option( 'users_can_register' ) ) : $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); /** This filter is documented in wp-login.php */ echo apply_filters( 'register', $registration_url ) . ' | '; endif; ?> <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a> <?php endif; ?> </p> <?php } ?> <script type="text/javascript"> function wp_attempt_focus(){ setTimeout( function(){ try{ <?php if ( $user_login || $interim_login ) { ?> d = document.getElementById('user_pass'); d.value = ''; <?php } else { ?> d = document.getElementById('user_login'); <?php if ( 'invalid_username' == $errors->get_error_code() ) { ?> if( d.value != '' ) d.value = ''; <?php } }?> d.focus(); d.select(); } catch(e){} }, 200); } <?php if ( !$error ) { ?> wp_attempt_focus(); <?php } ?> if(typeof wpOnload=='function')wpOnload(); <?php if ( $interim_login ) { ?> (function(){ try { var i, links = document.getElementsByTagName('a'); for ( i in links ) { if ( links[i].href ) links[i].target = '_blank'; } } catch(e){} }()); <?php } ?> </script> <?php login_footer(); break; } // end action switch
01-wordpress-paypal
trunk/wp-login.php
PHP
gpl3
32,671
<?php // Silence is golden.
01-wordpress-paypal
trunk/wp-content/index.php
PHP
gpl3
28
<?php /** * The main template file * * This is the most generic template file in a WordPress theme and one of the * two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * For example, it puts together the home page when no home.php file exists. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/index.php
PHP
gpl3
1,021
<?php /** * The Header template for our theme * * Displays all of the <head> section and everything up till <div id="main"> * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?><!DOCTYPE html> <!--[if IE 7]> <html class="ie ie7" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 8]> <html class="ie ie8" <?php language_attributes(); ?>> <![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--> <html <?php language_attributes(); ?>> <!--<![endif]--> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <title><?php wp_title( '|', true, 'right' ); ?></title> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="page" class="hfeed site"> <header id="masthead" class="site-header" role="banner"> <a class="home-link" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> <h1 class="site-title"><?php bloginfo( 'name' ); ?></h1> <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> </a> <div id="navbar" class="navbar"> <nav id="site-navigation" class="navigation main-navigation" role="navigation"> <h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3> <a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> <?php get_search_form(); ?> </nav><!-- #site-navigation --> </div><!-- #navbar --> </header><!-- #masthead --> <div id="main" class="site-main">
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/header.php
PHP
gpl3
1,982
<?php /** * The template for displaying all single posts * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php twentythirteen_post_nav(); ?> <?php comments_template(); ?> <?php endwhile; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/single.php
PHP
gpl3
600
<?php /** * Twenty Thirteen functions and definitions * * Sets up the theme and provides some helper functions, which are used in the * theme as custom template tags. Others are attached to action and filter * hooks in WordPress to change core functionality. * * When using a child theme (see http://codex.wordpress.org/Theme_Development * and http://codex.wordpress.org/Child_Themes), you can override certain * functions (those wrapped in a function_exists() call) by defining them first * in your child theme's functions.php file. The child theme's functions.php * file is included before the parent theme's file, so the child theme * functions would be used. * * Functions that are not pluggable (not wrapped in function_exists()) are * instead attached to a filter or action hook. * * For more information on hooks, actions, and filters, @link http://codex.wordpress.org/Plugin_API * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ /* * Set up the content width value based on the theme's design. * * @see twentythirteen_content_width() for template-specific adjustments. */ if ( ! isset( $content_width ) ) $content_width = 604; /** * Add support for a custom header image. */ require get_template_directory() . '/inc/custom-header.php'; /** * Twenty Thirteen only works in WordPress 3.6 or later. */ if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) ) require get_template_directory() . '/inc/back-compat.php'; /** * Twenty Thirteen setup. * * Sets up theme defaults and registers the various WordPress features that * Twenty Thirteen supports. * * @uses load_theme_textdomain() For translation/localization support. * @uses add_editor_style() To add Visual Editor stylesheets. * @uses add_theme_support() To add support for automatic feed links, post * formats, and post thumbnails. * @uses register_nav_menu() To add support for a navigation menu. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @since Twenty Thirteen 1.0 */ function twentythirteen_setup() { /* * Makes Twenty Thirteen available for translation. * * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Thirteen, use a find and * replace to change 'twentythirteen' to the name of your theme in all * template files. */ load_theme_textdomain( 'twentythirteen', get_template_directory() . '/languages' ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ add_editor_style( array( 'css/editor-style.css', 'fonts/genericons.css', twentythirteen_fonts_url() ) ); // Adds RSS feed links to <head> for posts and comments. add_theme_support( 'automatic-feed-links' ); /* * Switches default core markup for search form, comment form, * and comments to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); /* * This theme supports all available post formats by default. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Navigation Menu', 'twentythirteen' ) ); /* * This theme uses a custom image size for featured images, displayed on * "standard" posts and pages. */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 604, 270, true ); // This theme uses its own gallery styles. add_filter( 'use_default_gallery_style', '__return_false' ); } add_action( 'after_setup_theme', 'twentythirteen_setup' ); /** * Return the Google font stylesheet URL, if available. * * The use of Source Sans Pro and Bitter by default is localized. For languages * that use characters not supported by the font, the font can be disabled. * * @since Twenty Thirteen 1.0 * * @return string Font stylesheet or empty string if disabled. */ function twentythirteen_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Source Sans Pro, translate this to 'off'. Do not translate * into your own language. */ $source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'twentythirteen' ); /* Translators: If there are characters in your language that are not * supported by Bitter, translate this to 'off'. Do not translate into your * own language. */ $bitter = _x( 'on', 'Bitter font: on or off', 'twentythirteen' ); if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) { $font_families = array(); if ( 'off' !== $source_sans_pro ) $font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic'; if ( 'off' !== $bitter ) $font_families[] = 'Bitter:400,700'; $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" ); } return $fonts_url; } /** * Enqueue scripts and styles for the front end. * * @since Twenty Thirteen 1.0 */ function twentythirteen_scripts_styles() { /* * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); // Adds Masonry to handle vertical alignment of footer widgets. if ( is_active_sidebar( 'sidebar-1' ) ) wp_enqueue_script( 'jquery-masonry' ); // Loads JavaScript file with functionality specific to Twenty Thirteen. wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-03-18', true ); // Add Source Sans Pro and Bitter fonts, used in the main stylesheet. wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null ); // Add Genericons font, used in the main stylesheet. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' ); // Loads our main stylesheet. wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' ); // Loads the Internet Explorer specific stylesheet. wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' ); wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' ); } add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' ); /** * Filter the page title. * * Creates a nicely formatted and more specific title element text for output * in head of document, based on current view. * * @since Twenty Thirteen 1.0 * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string The filtered title. */ function twentythirteen_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name', 'display' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'twentythirteen_wp_title', 10, 2 ); /** * Register two widget areas. * * @since Twenty Thirteen 1.0 */ function twentythirteen_widgets_init() { register_sidebar( array( 'name' => __( 'Main Widget Area', 'twentythirteen' ), 'id' => 'sidebar-1', 'description' => __( 'Appears in the footer section of the site.', 'twentythirteen' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Secondary Widget Area', 'twentythirteen' ), 'id' => 'sidebar-2', 'description' => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'twentythirteen_widgets_init' ); if ( ! function_exists( 'twentythirteen_paging_nav' ) ) : /** * Display navigation to next/previous set of posts when applicable. * * @since Twenty Thirteen 1.0 */ function twentythirteen_paging_nav() { global $wp_query; // Don't print empty markup if there's only one page. if ( $wp_query->max_num_pages < 2 ) return; ?> <nav class="navigation paging-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1> <div class="nav-links"> <?php if ( get_next_posts_link() ) : ?> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentythirteen' ) ); ?></div> <?php endif; ?> <?php if ( get_previous_posts_link() ) : ?> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></div> <?php endif; ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php } endif; if ( ! function_exists( 'twentythirteen_post_nav' ) ) : /** * Display navigation to next/previous post when applicable. * * @since Twenty Thirteen 1.0 */ function twentythirteen_post_nav() { global $post; // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; ?> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1> <div class="nav-links"> <?php previous_post_link( '%link', _x( '<span class="meta-nav">&larr;</span> %title', 'Previous post link', 'twentythirteen' ) ); ?> <?php next_post_link( '%link', _x( '%title <span class="meta-nav">&rarr;</span>', 'Next post link', 'twentythirteen' ) ); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php } endif; if ( ! function_exists( 'twentythirteen_entry_meta' ) ) : /** * Print HTML with meta information for current post: categories, tags, permalink, author, and date. * * Create your own twentythirteen_entry_meta() to override in a child theme. * * @since Twenty Thirteen 1.0 */ function twentythirteen_entry_meta() { if ( is_sticky() && is_home() && ! is_paged() ) echo '<span class="featured-post">' . __( 'Sticky', 'twentythirteen' ) . '</span>'; if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) twentythirteen_entry_date(); // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) ); if ( $categories_list ) { echo '<span class="categories-links">' . $categories_list . '</span>'; } // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) ); if ( $tag_list ) { echo '<span class="tags-links">' . $tag_list . '</span>'; } // Post author if ( 'post' == get_post_type() ) { printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ), get_the_author() ); } } endif; if ( ! function_exists( 'twentythirteen_entry_date' ) ) : /** * Print HTML with date information for current post. * * Create your own twentythirteen_entry_date() to override in a child theme. * * @since Twenty Thirteen 1.0 * * @param boolean $echo (optional) Whether to echo the date. Default true. * @return string The HTML-formatted post date. */ function twentythirteen_entry_date( $echo = true ) { if ( has_post_format( array( 'chat', 'status' ) ) ) $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' ); else $format_prefix = '%2$s'; $date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>', esc_url( get_permalink() ), esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ), esc_attr( get_the_date( 'c' ) ), esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) ) ); if ( $echo ) echo $date; return $date; } endif; if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) : /** * Print the attached image with a link to the next attached image. * * @since Twenty Thirteen 1.0 */ function twentythirteen_the_attached_image() { /** * Filter the image attachment size to use. * * @since Twenty thirteen 1.0 * * @param array $size { * @type int The attachment height in pixels. * @type int The attachment width in pixels. * } */ $attachment_size = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) ); $next_attachment_url = wp_get_attachment_url(); $post = get_post(); /* * Grab the IDs of all the image attachments in a gallery so we can get the URL * of the next adjacent image in a gallery, or the first image (if we're * looking at the last image in a gallery), or, in a gallery of one, just the * link to that image file. */ $attachment_ids = get_posts( array( 'post_parent' => $post->post_parent, 'fields' => 'ids', 'numberposts' => -1, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ); // If there is more than 1 attachment in a gallery... if ( count( $attachment_ids ) > 1 ) { foreach ( $attachment_ids as $attachment_id ) { if ( $attachment_id == $post->ID ) { $next_id = current( $attachment_ids ); break; } } // get the URL of the next image attachment... if ( $next_id ) $next_attachment_url = get_attachment_link( $next_id ); // or get the URL of the first image attachment. else $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) ); } printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>', esc_url( $next_attachment_url ), the_title_attribute( array( 'echo' => false ) ), wp_get_attachment_image( $post->ID, $attachment_size ) ); } endif; /** * Return the post URL. * * @uses get_url_in_content() to get the URL in the post meta (if it exists) or * the first link found in the post content. * * Falls back to the post permalink if no URL is found in the post. * * @since Twenty Thirteen 1.0 * * @return string The Link format URL. */ function twentythirteen_get_link_url() { $content = get_the_content(); $has_url = get_url_in_content( $content ); return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } /** * Extend the default WordPress body classes. * * Adds body classes to denote: * 1. Single or multiple authors. * 2. Active widgets in the sidebar to change the layout and spacing. * 3. When avatars are disabled in discussion settings. * * @since Twenty Thirteen 1.0 * * @param array $classes A list of existing body class values. * @return array The filtered body class list. */ function twentythirteen_body_class( $classes ) { if ( ! is_multi_author() ) $classes[] = 'single-author'; if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() ) $classes[] = 'sidebar'; if ( ! get_option( 'show_avatars' ) ) $classes[] = 'no-avatars'; return $classes; } add_filter( 'body_class', 'twentythirteen_body_class' ); /** * Adjust content_width value for video post formats and attachment templates. * * @since Twenty Thirteen 1.0 */ function twentythirteen_content_width() { global $content_width; if ( is_attachment() ) $content_width = 724; elseif ( has_post_format( 'audio' ) ) $content_width = 484; } add_action( 'template_redirect', 'twentythirteen_content_width' ); /** * Add postMessage support for site title and description for the Customizer. * * @since Twenty Thirteen 1.0 * * @param WP_Customize_Manager $wp_customize Customizer object. */ function twentythirteen_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; } add_action( 'customize_register', 'twentythirteen_customize_register' ); /** * Enqueue Javascript postMessage handlers for the Customizer. * * Binds JavaScript handlers to make the Customizer preview * reload changes asynchronously. * * @since Twenty Thirteen 1.0 */ function twentythirteen_customize_preview_js() { wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true ); } add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/functions.php
PHP
gpl3
17,732
<?php /** * The sidebar containing the footer widget area * * If no active widgets in this sidebar, hide it completely. * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ if ( is_active_sidebar( 'sidebar-1' ) ) : ?> <div id="secondary" class="sidebar-container" role="complementary"> <div class="widget-area"> <?php dynamic_sidebar( 'sidebar-1' ); ?> </div><!-- .widget-area --> </div><!-- #secondary --> <?php endif; ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/sidebar-main.php
PHP
gpl3
472
<?php /** * The template for displaying posts in the Aside post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php if ( is_single() ) : ?> <?php twentythirteen_entry_meta(); ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> <?php if ( get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> <?php else : ?> <?php twentythirteen_entry_date(); ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> <?php endif; // is_single() ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-aside.php
PHP
gpl3
1,226
<?php /** * The template for displaying posts in the Gallery post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> <?php endif; // is_single() ?> </header><!-- .entry-header --> <div class="entry-content"> <?php if ( is_single() || ! get_post_gallery() ) : ?> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> <?php else : ?> <?php echo get_post_gallery(); ?> <?php endif; // is_single() ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php if ( comments_open() && ! is_single() ) : ?> <span class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?> </span><!-- .comments-link --> <?php endif; // comments_open() ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-gallery.php
PHP
gpl3
1,843
<?php /** * The template for displaying image attachments * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>> <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="entry-meta"> <?php $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' ); $post_title = get_the_title( $post->post_parent ); if ( empty( $post_title ) || 0 == $post->post_parent ) $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>'; printf( $published_text, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_permalink( $post->post_parent ) ), esc_attr( strip_tags( $post_title ) ), $post_title ); $metadata = wp_get_attachment_metadata(); printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>', esc_url( wp_get_attachment_url() ), esc_attr__( 'Link to full-size image', 'twentythirteen' ), __( 'Full resolution', 'twentythirteen' ), $metadata['width'], $metadata['height'] ); edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <nav id="image-navigation" class="navigation image-navigation" role="navigation"> <span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span> <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span> </nav><!-- #image-navigation --> <div class="entry-attachment"> <div class="attachment"> <?php twentythirteen_the_attached_image(); ?> <?php if ( has_excerpt() ) : ?> <div class="entry-caption"> <?php the_excerpt(); ?> </div> <?php endif; ?> </div><!-- .attachment --> </div><!-- .entry-attachment --> <?php if ( ! empty( $post->post_content ) ) : ?> <div class="entry-description"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-description --> <?php endif; ?> </div><!-- .entry-content --> </article><!-- #post --> <?php comments_template(); ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/image.php
PHP
gpl3
3,096
<?php /** * Implement a custom header for Twenty Thirteen * * @link http://codex.wordpress.org/Custom_Headers * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ /** * Set up the WordPress core custom header arguments and settings. * * @uses add_theme_support() to register support for 3.4 and up. * @uses twentythirteen_header_style() to style front-end. * @uses twentythirteen_admin_header_style() to style wp-admin form. * @uses twentythirteen_admin_header_image() to add custom markup to wp-admin form. * @uses register_default_headers() to set up the bundled header images. * * @since Twenty Thirteen 1.0 */ function twentythirteen_custom_header_setup() { $args = array( // Text color and image (empty to use none). 'default-text-color' => '220e10', 'default-image' => '%s/images/headers/circle.png', // Set height and width, with a maximum value for the width. 'height' => 230, 'width' => 1600, // Callbacks for styling the header and the admin preview. 'wp-head-callback' => 'twentythirteen_header_style', 'admin-head-callback' => 'twentythirteen_admin_header_style', 'admin-preview-callback' => 'twentythirteen_admin_header_image', ); add_theme_support( 'custom-header', $args ); /* * Default custom headers packaged with the theme. * %s is a placeholder for the theme template directory URI. */ register_default_headers( array( 'circle' => array( 'url' => '%s/images/headers/circle.png', 'thumbnail_url' => '%s/images/headers/circle-thumbnail.png', 'description' => _x( 'Circle', 'header image description', 'twentythirteen' ) ), 'diamond' => array( 'url' => '%s/images/headers/diamond.png', 'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png', 'description' => _x( 'Diamond', 'header image description', 'twentythirteen' ) ), 'star' => array( 'url' => '%s/images/headers/star.png', 'thumbnail_url' => '%s/images/headers/star-thumbnail.png', 'description' => _x( 'Star', 'header image description', 'twentythirteen' ) ), ) ); } add_action( 'after_setup_theme', 'twentythirteen_custom_header_setup', 11 ); /** * Load our special font CSS files. * * @since Twenty Thirteen 1.0 */ function twentythirteen_custom_header_fonts() { // Add Source Sans Pro and Bitter fonts. wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null ); // Add Genericons font. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' ); } add_action( 'admin_print_styles-appearance_page_custom-header', 'twentythirteen_custom_header_fonts' ); /** * Style the header text displayed on the blog. * * get_header_textcolor() options: Hide text (returns 'blank'), or any hex value. * * @since Twenty Thirteen 1.0 */ function twentythirteen_header_style() { $header_image = get_header_image(); $text_color = get_header_textcolor(); // If no custom options for text are set, let's bail. if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) return; // If we get this far, we have custom styles. ?> <style type="text/css" id="twentythirteen-header-css"> <?php if ( ! empty( $header_image ) ) : ?> .site-header { background: url(<?php header_image(); ?>) no-repeat scroll top; background-size: 1600px auto; } <?php endif; // Has the text been hidden? if ( ! display_header_text() ) : ?> .site-title, .site-description { position: absolute; clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); } <?php if ( empty( $header_image ) ) : ?> .site-header .home-link { min-height: 0; } <?php endif; // If the user has set a custom color for the text, use that. elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) : ?> .site-title, .site-description { color: #<?php echo esc_attr( $text_color ); ?>; } <?php endif; ?> </style> <?php } /** * Style the header image displayed on the Appearance > Header admin panel. * * @since Twenty Thirteen 1.0 */ function twentythirteen_admin_header_style() { $header_image = get_header_image(); ?> <style type="text/css" id="twentythirteen-admin-header-css"> .appearance_page_custom-header #headimg { border: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; <?php if ( ! empty( $header_image ) ) { echo 'background: url(' . esc_url( $header_image ) . ') no-repeat scroll top; background-size: 1600px auto;'; } ?> padding: 0 20px; } #headimg .home-link { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin: 0 auto; max-width: 1040px; <?php if ( ! empty( $header_image ) || display_header_text() ) { echo 'min-height: 230px;'; } ?> width: 100%; } <?php if ( ! display_header_text() ) : ?> #headimg h1, #headimg h2 { position: absolute !important; clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); } <?php endif; ?> #headimg h1 { font: bold 60px/1 Bitter, Georgia, serif; margin: 0; padding: 58px 0 10px; } #headimg h1 a { text-decoration: none; } #headimg h1 a:hover { text-decoration: underline; } #headimg h2 { font: 200 italic 24px "Source Sans Pro", Helvetica, sans-serif; margin: 0; text-shadow: none; } .default-header img { max-width: 230px; width: auto; } </style> <?php } /** * Output markup to be displayed on the Appearance > Header admin panel. * * This callback overrides the default markup displayed there. * * @since Twenty Thirteen 1.0 */ function twentythirteen_admin_header_image() { ?> <div id="headimg" style="background: url(<?php header_image(); ?>) no-repeat scroll top; background-size: 1600px auto;"> <?php $style = ' style="color:#' . get_header_textcolor() . ';"'; ?> <div class="home-link"> <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="#"><?php bloginfo( 'name' ); ?></a></h1> <h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2> </div> </div> <?php }
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/inc/custom-header.php
PHP
gpl3
6,336
<?php /** * Twenty Thirteen back compat functionality * * Prevents Twenty Thirteen from running on WordPress versions prior to 3.6, * since this theme is not meant to be backward compatible and relies on * many new functions and markup changes introduced in 3.6. * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ /** * Prevent switching to Twenty Thirteen on old versions of WordPress. * * Switches to the default theme. * * @since Twenty Thirteen 1.0 */ function twentythirteen_switch_theme() { switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME ); unset( $_GET['activated'] ); add_action( 'admin_notices', 'twentythirteen_upgrade_notice' ); } add_action( 'after_switch_theme', 'twentythirteen_switch_theme' ); /** * Add message for unsuccessful theme switch. * * Prints an update nag after an unsuccessful attempt to switch to * Twenty Thirteen on WordPress versions prior to 3.6. * * @since Twenty Thirteen 1.0 */ function twentythirteen_upgrade_notice() { $message = sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ); printf( '<div class="error"><p>%s</p></div>', $message ); } /** * Prevent the Theme Customizer from being loaded on WordPress versions prior to 3.6. * * @since Twenty Thirteen 1.0 */ function twentythirteen_customize() { wp_die( sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ), '', array( 'back_link' => true, ) ); } add_action( 'load-customize.php', 'twentythirteen_customize' ); /** * Prevent the Theme Preview from being loaded on WordPress versions prior to 3.4. * * @since Twenty Thirteen 1.0 */ function twentythirteen_preview() { if ( isset( $_GET['preview'] ) ) { wp_die( sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ) ); } } add_action( 'template_redirect', 'twentythirteen_preview' );
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/inc/back-compat.php
PHP
gpl3
2,181
<?php /** * The template for displaying all pages * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages and that other * 'pages' on your WordPress site will use a different template. * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( has_post_thumbnail() && ! post_password_required() ) : ?> <div class="entry-thumbnail"> <?php the_post_thumbnail(); ?> </div> <?php endif; ?> <h1 class="entry-title"><?php the_title(); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post --> <?php comments_template(); ?> <?php endwhile; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/page.php
PHP
gpl3
1,608
<?php /** * The template for displaying posts in the Link post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"> <a href="<?php echo esc_url( twentythirteen_get_link_url() ); ?>"><?php the_title(); ?></a> </h1> <div class="entry-meta"> <?php twentythirteen_entry_date(); ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <?php if ( is_single() ) : ?> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php if ( get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> </footer><!-- .entry-meta --> <?php endif; // is_single() ?> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-link.php
PHP
gpl3
1,350
/** * Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. * Things like site title and description changes. */ ( function( $ ) { // Site title and description. wp.customize( 'blogname', function( value ) { value.bind( function( to ) { $( '.site-title' ).text( to ); } ); } ); wp.customize( 'blogdescription', function( value ) { value.bind( function( to ) { $( '.site-description' ).text( to ); } ); } ); // Header text color. wp.customize( 'header_textcolor', function( value ) { value.bind( function( to ) { if ( 'blank' == to ) { if ( 'remove-header' == _wpCustomizeSettings.values.header_image ) $( '.home-link' ).css( 'min-height', '0' ); $( '.site-title, .site-description' ).css( { 'clip': 'rect(1px, 1px, 1px, 1px)', 'position': 'absolute' } ); } else { $( '.home-link' ).css( 'min-height', '230px' ); $( '.site-title, .site-description' ).css( { 'clip': 'auto', 'color': to, 'position': 'relative' } ); } } ); } ); } )( jQuery );
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/js/theme-customizer.js
JavaScript
gpl3
1,128
/** * Functionality specific to Twenty Thirteen. * * Provides helper functions to enhance the theme experience. */ ( function( $ ) { var body = $( 'body' ), _window = $( window ); /** * Adds a top margin to the footer if the sidebar widget area is higher * than the rest of the page, to help the footer always visually clear * the sidebar. */ $( function() { if ( body.is( '.sidebar' ) ) { var sidebar = $( '#secondary .widget-area' ), secondary = ( 0 === sidebar.length ) ? -40 : sidebar.height(), margin = $( '#tertiary .widget-area' ).height() - $( '#content' ).height() - secondary; if ( margin > 0 && _window.innerWidth() > 999 ) { $( '#colophon' ).css( 'margin-top', margin + 'px' ); } } } ); /** * Enables menu toggle for small screens. */ ( function() { var nav = $( '#site-navigation' ), button, menu; if ( ! nav ) { return; } button = nav.find( '.menu-toggle' ); if ( ! button ) { return; } // Hide button if menu is missing or empty. menu = nav.find( '.nav-menu' ); if ( ! menu || ! menu.children().length ) { button.hide(); return; } button.on( 'click.twentythirteen', function() { nav.toggleClass( 'toggled-on' ); } ); // Better focus for hidden submenu items for accessibility. menu.find( 'a' ).on( 'focus.twentythirteen blur.twentythirteen', function() { $( this ).parents( '.menu-item, .page_item' ).toggleClass( 'focus' ); } ); } )(); /** * Makes "skip to content" link work correctly in IE9 and Chrome for better * accessibility. * * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ */ _window.on( 'hashchange.twentythirteen', function() { var element = document.getElementById( location.hash.substring( 1 ) ); if ( element ) { if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) { element.tabIndex = -1; } element.focus(); } } ); /** * Arranges footer widgets vertically. */ if ( $.isFunction( $.fn.masonry ) ) { var columnWidth = body.is( '.sidebar' ) ? 228 : 245; $( '#secondary .widget-area' ).masonry( { itemSelector: '.widget', columnWidth: columnWidth, gutterWidth: 20, isRTL: body.is( '.rtl' ) } ); } } )( jQuery );
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/js/functions.js
JavaScript
gpl3
2,275
<?php /** * The template for displaying Tag pages * * Used to display archive-type pages for posts in a tag. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"><?php printf( __( 'Tag Archives: %s', 'twentythirteen' ), single_tag_title( '', false ) ); ?></h1> <?php if ( tag_description() ) : // Show an optional tag description ?> <div class="archive-meta"><?php echo tag_description(); ?></div> <?php endif; ?> </header><!-- .archive-header --> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/tag.php
PHP
gpl3
1,168
<?php /** * The template for displaying posts in the Status post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-status.php
PHP
gpl3
1,011
<?php /** * The template for displaying posts in the Video post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> <?php endif; // is_single() ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php if ( comments_open() && ! is_single() ) : ?> <span class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?> </span><!-- .comments-link --> <?php endif; // comments_open() ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-video.php
PHP
gpl3
1,695
/* Theme Name: Twenty Thirteen Description: Adds support for languages written in a Right To Left (RTL) direction. It's easy, just a matter of overwriting all the horizontal positioning attributes of your CSS stylesheet in a separate stylesheet file named rtl.css. See http://codex.wordpress.org/Right_to_Left_Language_Support */ /** * Table of Contents: * * 1.0 - Reset * 4.0 - Header * 4.1 - Site Header * 4.2 - Navigation * 5.0 - Content * 5.2 - Entry Meta * 5.4 - Galleries * 5.5 - Post Formats * 5.6 - Attachments * 5.7 - Post/Paging Navigation * 5.8 - Author Bio * 5.9 - Archives * 5.10 - Search Results/No posts * 5.12 - Comments * 6.0 - Sidebar * 6.1 - Widgets * 7.0 - Footer * 8.0 - Media Queries * 9.0 - Print * ---------------------------------------------------------------------------- */ /** * 1.0 Reset * ---------------------------------------------------------------------------- */ body { direction: rtl; unicode-bidi: embed; } a { display: inline-block; } blockquote blockquote { margin-left: 0; margin-right: 24px; } menu, ol, ul { padding: 0 40px 0 0; } caption, th, td { text-align: right; } td { padding-left: 10px; padding-right: 0; } .assistive-text:focus { left: auto; right: 5px; } /** * 4.0 Header * ---------------------------------------------------------------------------- */ /** * 4.1 Site Header * ---------------------------------------------------------------------------- */ .site-header > a:first-child { display: inherit; } .site-description { font-style: normal; } /** * 4.2 Navigation * ---------------------------------------------------------------------------- */ /* Navbar */ ul.nav-menu, div.nav-menu > ul { margin: 0 -20px 0 0; padding: 0 0 0 40px; } .nav-menu .sub-menu, .nav-menu .children { float: right; left: auto; right: -2px; } .nav-menu .sub-menu ul, .nav-menu .children ul { border-left: 2px solid #f7f5e7; border-right: 0; left: auto; right: 100%; } .main-navigation .search-form { left: 0; right: auto; } .site-header .search-field { background-position: 98% center; padding: 0 34px 0 0; } .nav-menu .current_page_item > a, .nav-menu .current_page_ancestor > a, .nav-menu .current-menu-item > a, .nav-menu .current-menu-ancestor > a { font-style: normal; } .menu-toggle { padding-left: 0; padding-right: 20px; } /** * 5.0 Content * ---------------------------------------------------------------------------- */ .sidebar .entry-header, .sidebar .entry-content, .sidebar .entry-summary, .sidebar .entry-meta { padding-left: 376px; padding-right: 60px; } /** * 5.2 Entry Meta * ---------------------------------------------------------------------------- */ .entry-meta > span { margin-left: 20px; margin-right: auto; } .entry-meta > span:last-child { margin-left: 0; margin-right: auto; } .featured-post:before { margin-left: 2px; margin-right: auto; } .entry-meta .date a:before { margin-left: 2px; } .comments-link a:before { margin-left: 2px; margin-right: auto; } .tags-links a:first-child:before { margin-left: 2px; } .edit-link a:before { margin-left: 2px; } .page-links .page-links-title { margin-left: 20px; margin-right: auto; } /** * 5.4 Galleries * ---------------------------------------------------------------------------- */ .gallery { margin-left: auto; margin-right: -4px; } .gallery-item { float: right; margin: 0 0 4px 4px; } .gallery-item a { display: inline; } /** * 5.5 Post Formats * ---------------------------------------------------------------------------- */ .entry-content a { display: inline; } .format-aside cite:before { content: normal; margin-right: auto; } .format-aside cite:after { content: "\2014"; margin-left: 5px; } .format-audio .entry-content:before { float: right; -webkit-transform: scaleX(-1); -moz-transform: scaleX(-1); -ms-transform: scaleX(-1); -o-transform: scaleX(-1); transform: scaleX(-1); } .format-audio .audio-content { background-position: right top; float: left; padding-left: 0; padding-right: 35px; } .format-chat .entry-meta .date a:before { margin-left: 4px; margin-right: auto; } .format-image .wp-caption-text { text-align: right; } .format-link .entry-title { margin-left: 20px; margin-right: auto; } .format-status .entry-content, .format-status .entry-meta { padding-left: 0; padding-right: 35px; } .sidebar .format-status .entry-content, .sidebar .format-status .entry-meta { padding-left: 376px; padding-right: 95px; } .format-status .entry-content:before, .format-status .entry-meta:before { left: auto; right: 10px; } .sidebar .format-status .entry-content:before, .sidebar .format-status .entry-meta:before { left: auto; right: 70px; } .format-status .entry-content p:first-child:before { left: auto; right: 4px; } .sidebar .format-status .entry-content p:first-child:before { left: auto; right: 64px; } .format-quote blockquote { padding-left: 0; padding-right: 75px; } .format-quote blockquote:before { content: '\201D'; padding-left: 25px; padding-right: 0; left: auto; right: -15px; } /** * 5.6 Attachments * ---------------------------------------------------------------------------- */ .attachment .entry-title { float: right; } .attachment .entry-title:before { margin-left: 10px; margin-right: auto; } .attachment .entry-meta { float: left; } .image-navigation .nav-previous { left: auto; right: 0; } .image-navigation .nav-next { left: 0; right: auto; } .attachment .entry-caption { text-align: right; } /** * 5.7 Post/Paging Navigation * ---------------------------------------------------------------------------- */ .navigation .nav-previous { float: right; } .navigation .nav-next { float: left; } .sidebar .paging-navigation .nav-links, .sidebar .post-navigation .nav-links { padding-left: 376px; padding-right: 60px; } .paging-navigation .nav-previous .meta-nav { margin-left: 10px; margin-right: auto; } .paging-navigation .nav-next .meta-nav { margin-left: auto; margin-right: 10px; } .post-navigation a[rel="next"] { float: left; text-align: left; } /** * 5.8 Author Bio * ---------------------------------------------------------------------------- */ .author-info { text-align: right; /* gallery & video post formats */ } .author.sidebar .author-info { padding-left: 376px; padding-right: 60px; } .author-avatar .avatar { float: right; margin: 0 0 30px 30px; } .author-link { margin-left: auto; margin-right: 2px; } /** * 5.9 Archives * ---------------------------------------------------------------------------- */ .sidebar .archive-meta { padding-left: 316px; padding-right: 0; } /** * 5.10 Search Results/No posts * ---------------------------------------------------------------------------- */ .sidebar .page-content { padding-left: 376px; padding-right: 60px; } /** * 5.12 Comments * ---------------------------------------------------------------------------- */ .sidebar .comments-title, .sidebar .comment-list, .sidebar .comment-reply-title, .sidebar .comment-navigation, .sidebar .comment-respond .comment-form { padding-left: 376px; padding-right: 60px; } .comment-list .children { margin-left: auto; margin-right: 20px; } .comment-author { float: right; margin-left: 50px; margin-right: auto; } .comment-list .edit-link { margin-left: auto; margin-right: 20px; } .comment-metadata, .comment-content, .comment-list .reply, .comment-awaiting-moderation { float: left; } .comment-awaiting-moderation:before { margin-left: 5px; margin-right: auto; } .comment-reply-link:before, .comment-reply-login:before { margin-left: 3px; margin-right: auto; -webkit-transform: scaleX(-1); -moz-transform: scaleX(-1); -ms-transform: scaleX(-1); -o-transform: scaleX(-1); transform: scaleX(-1); } .comment-reply-title small a { float: left; } .comment-form [for="author"], .comment-form [for="email"], .comment-form [for="url"], .comment-form [for="comment"] { float: right; } .form-allowed-tags code { margin-left: auto; margin-right: 3px; } .sidebar .no-comments { padding-left: 376px; padding-right: 60px; } /** * 6.0 Sidebar * ---------------------------------------------------------------------------- */ .site-main .widget-area { float: left; } .widget-area a { max-width: 100%; } /** * 6.1 Widgets * ---------------------------------------------------------------------------- */ .widget .widget-title { font-style: normal; } .widget li > ul, .widget li > ol { margin-left: auto; margin-right: 20px; } /** * 7.0 Footer * ---------------------------------------------------------------------------- */ .site-footer .widget-area, .sidebar .site-footer { text-align: right; } .sidebar .site-footer .widget-area { left: auto; right: -158px; } .site-footer .widget { float: right; margin-left: 20px; margin-right: auto; } .sidebar .site-footer .widget:nth-of-type(4), .sidebar .site-footer .widget:nth-of-type(3) { margin-left: 0; margin-right: auto; } /** * 8.0 Media Queries * ---------------------------------------------------------------------------- */ @media (max-width: 1069px) { ul.nav-menu, div.nav-menu > ul { margin-left: auto; margin-right: 0; } .error404 .page-header, .sidebar .format-image .entry-content img.size-full, .sidebar .format-image .wp-caption:first-child .wp-caption-text { margin-right: auto; } .main-navigation .search-form { left: 20px; right: auto; } .site-main .widget-area { margin-left: 60px; margin-right: auto; } } @media (max-width: 999px) { .sidebar .entry-header, .sidebar .entry-content, .sidebar .entry-summary, .sidebar .entry-meta, .sidebar .comment-list, .sidebar .comment-reply-title, .sidebar .comment-navigation, .sidebar .comment-respond .comment-form, .sidebar .featured-gallery, .sidebar .post-navigation .nav-links, .author.sidebar .author-info, .sidebar .format-image .entry-content { max-width: 604px; padding-left: 0; padding-right: 0; } .site-main .widget-area { float: none; margin-left: auto; } .attachment .entry-meta { float: right; text-align: right; } .sidebar .format-status .entry-content, .sidebar .format-status .entry-meta { padding-left: 0; padding-right: 35px; } .sidebar .format-status .entry-content:before, .sidebar .format-status .entry-meta:before { left: auto; right: 10px; } .sidebar .format-status .entry-content p:first-child:before { left: auto; right: 4px; } .sidebar .site-footer .widget-area { left: auto; right: 0; } .sidebar .paging-navigation .nav-links { padding: 0 60px; } } @media (max-width: 767px) { .format-image .entry-content img:first-of-type, .format-image .wp-caption:first-child .wp-caption-text { margin-right: auto; } } @media (max-width: 643px) { .sidebar .entry-header, .sidebar .entry-content, .sidebar .entry-summary, .sidebar .entry-meta, .sidebar .comment-list, .sidebar .comment-navigation, .sidebar .featured-gallery, .sidebar .post-navigation .nav-links, .sidebar .format-image .entry-content { padding-left: 20px; padding-right: 20px; } #content .format-status .entry-content, #content .format-status .entry-met { padding-left: 0; padding-right: 35px; } .menu-toggle:after { padding-left: 0; padding-right: 8px; } .toggled-on .nav-menu, .toggled-on .nav-menu > ul { margin-left: auto; margin-right: 0; } .toggled-on .nav-menu li > ul { margin-left: auto; margin-right: 20px; right: auto; } #content .featured-gallery { padding-left: 0; padding-right: 24px; } .gallery-columns-1 .gallery-item { margin-left: 0; margin-right: auto; } .comment-author { margin-left: 30px; margin-right: auto; } .format-audio .audio-content { background: none; float: none; padding-left: 0; padding-right: 0; } .gallery-columns-3 .gallery-item:nth-of-type(3n) { margin-left: 4px; margin-right: auto; } } @media (max-width: 359px) { .gallery { margin-left: auto; margin-right: 0; } .gallery .gallery-item:nth-of-type(even) { margin-left: 0; margin-right: auto; } .gallery .gallery-item, .gallery.gallery-columns-3 .gallery-item:nth-of-type(even), .gallery-columns-3 .gallery-item:nth-of-type(3n), .gallery-columns-5 .gallery-item:nth-of-type(5n), .gallery-columns-7 .gallery-item:nth-of-type(7n), .gallery-columns-9 .gallery-item:nth-of-type(9n) { margin-left: 4px; margin-right: auto; } .comment-author .avatar { margin-left: 5px; margin-right: auto; } } /** * 9.0 Print * ---------------------------------------------------------------------------- */ @media print { .entry-content img.alignleft, .entry-content .wp-caption.alignleft { margin-left: auto; margin-right: 0; } .entry-content img.alignright, .entry-content .wp-caption.alignright { margin-left: 0; margin-right: auto; } }
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/rtl.css
CSS
gpl3
12,977
<?php /** * The template for displaying posts in the Image post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> <?php endif; // is_single() ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php if ( comments_open() && ! is_single() ) : ?> <span class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?> </span><!-- .comments-link --> <?php endif; // comments_open() ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-image.php
PHP
gpl3
1,695
<?php /** * The template for displaying Author archive pages * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <?php /* * Queue the first post, that way we know what author * we're dealing with (if that is the case). * * We reset this later so we can run the loop * properly with a call to rewind_posts(). */ the_post(); ?> <header class="archive-header"> <h1 class="archive-title"><?php printf( __( 'All posts by %s', 'twentythirteen' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1> </header><!-- .archive-header --> <?php /* * Since we called the_post() above, we need to * rewind the loop back to the beginning that way * we can run the loop properly, in full. */ rewind_posts(); ?> <?php if ( get_the_author_meta( 'description' ) ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/author.php
PHP
gpl3
1,719
<?php /** * The template for displaying the footer * * Contains footer content and the closing of the #main and #page div elements. * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> </div><!-- #main --> <footer id="colophon" class="site-footer" role="contentinfo"> <?php get_sidebar( 'main' ); ?> <div class="site-info"> <?php do_action( 'twentythirteen_credits' ); ?> <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/footer.php
PHP
gpl3
814
<?php /** * The template for displaying Archive pages * * Used to display archive-type pages if nothing more specific matches a query. * For example, puts together date-based pages if no date.php file exists. * * If you'd like to further customize these archive views, you may create a * new template file for each specific one. For example, Twenty Thirteen * already has tag.php for Tag archives, category.php for Category archives, * and author.php for Author archives. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"><?php if ( is_day() ) : printf( __( 'Daily Archives: %s', 'twentythirteen' ), get_the_date() ); elseif ( is_month() ) : printf( __( 'Monthly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) ) ); elseif ( is_year() ) : printf( __( 'Yearly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentythirteen' ) ) ); else : _e( 'Archives', 'twentythirteen' ); endif; ?></h1> </header><!-- .archive-header --> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/archive.php
PHP
gpl3
1,796
<?php /** * The template for displaying Post Format pages * * Used to display archive-type pages for posts with a post format. * If you'd like to further customize these Post Format views, you may create a * new template file for each specific one. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"><?php printf( __( '%s Archives', 'twentythirteen' ), '<span>' . get_post_format_string( get_post_format() ) . '</span>' ); ?></h1> </header><!-- .archive-header --> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/taxonomy-post_format.php
PHP
gpl3
1,176
<?php /** * The template for displaying Author bios * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <div class="author-info"> <div class="author-avatar"> <?php /** * Filter the author bio avatar size. * * @since Twenty Thirteen 1.0 * * @param int $size The avatar height and width size in pixels. */ $author_bio_avatar_size = apply_filters( 'twentythirteen_author_bio_avatar_size', 74 ); echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size ); ?> </div><!-- .author-avatar --> <div class="author-description"> <h2 class="author-title"><?php printf( __( 'About %s', 'twentythirteen' ), get_the_author() ); ?></h2> <p class="author-bio"> <?php the_author_meta( 'description' ); ?> <a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"> <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentythirteen' ), get_the_author() ); ?> </a> </p> </div><!-- .author-description --> </div><!-- .author-info -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/author-bio.php
PHP
gpl3
1,118
<?php /** * The template for displaying Category pages * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentythirteen' ), single_cat_title( '', false ) ); ?></h1> <?php if ( category_description() ) : // Show an optional category description ?> <div class="archive-meta"><?php echo category_description(); ?></div> <?php endif; ?> </header><!-- .archive-header --> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/category.php
PHP
gpl3
1,132
<?php /** * The default template for displaying content * * Used for both single and index/archive/search. * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( has_post_thumbnail() && ! post_password_required() && ! is_attachment() ) : ?> <div class="entry-thumbnail"> <?php the_post_thumbnail(); ?> </div> <?php endif; ?> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> <?php endif; // is_single() ?> <div class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <footer class="entry-meta"> <?php if ( comments_open() && ! is_single() ) : ?> <div class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?> </div><!-- .comments-link --> <?php endif; // comments_open() ?> <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content.php
PHP
gpl3
2,165
/* Theme Name: Twenty Thirteen Theme URI: http://wordpress.org/themes/twentythirteen Author: the WordPress team Author URI: http://wordpress.org/ Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small. Version: 1.1 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready Text Domain: twentythirteen This theme, like WordPress, is licensed under the GPL. Use it to make something cool, have fun, and share what you've learned with others. */ /** * Table of Contents: * * 1.0 - Reset * 2.0 - Repeatable Patterns * 3.0 - Basic Structure * 4.0 - Header * 4.1 - Site Header * 4.2 - Navigation * 5.0 - Content * 5.1 - Entry Header * 5.2 - Entry Meta * 5.3 - Entry Content * 5.4 - Galleries * 5.5 - Post Formats * 5.6 - Attachments * 5.7 - Post/Paging Navigation * 5.8 - Author Bio * 5.9 - Archives * 5.10 - Search Results/No posts * 5.11 - 404 * 5.12 - Comments * 5.13 - Multisite * 6.0 - Sidebar * 6.1 - Widgets * 7.0 - Footer * 8.0 - Media Queries * 9.0 - Print * ---------------------------------------------------------------------------- */ /** * 1.0 Reset * * Modified from Normalize.css to provide cross-browser consistency and a smart * default styling of HTML elements. * * @see http://git.io/normalize * ---------------------------------------------------------------------------- */ * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } article, aside, details, figcaption, figure, footer, header, nav, section, summary { display: block; } audio, canvas, video { display: inline-block; } audio:not([controls]) { display: none; height: 0; } [hidden] { display: none; } html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } html, button, input, select, textarea { font-family: "Source Sans Pro", Helvetica, sans-serif; } body { color: #141412; line-height: 1.5; margin: 0; } a { color: #ca3c08; text-decoration: none; } a:visited { color: #ac0404; } a:focus { outline: thin dotted; } a:active, a:hover { color: #ea9629; outline: 0; } a:hover { text-decoration: underline; } h1, h2, h3, h4, h5, h6 { clear: both; font-family: Bitter, Georgia, serif; line-height: 1.3; } h1 { font-size: 48px; margin: 33px 0; } h2 { font-size: 30px; margin: 25px 0; } h3 { font-size: 22px; margin: 22px 0; } h4 { font-size: 20px; margin: 25px 0; } h5 { font-size: 18px; margin: 30px 0; } h6 { font-size: 16px; margin: 36px 0; } address { font-style: italic; margin: 0 0 24px; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } mark { background: #ff0; color: #000; } p { margin: 0 0 24px; } code, kbd, pre, samp { font-family: monospace, serif; font-size: 14px; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; } pre { background: #f5f5f5; color: #666; font-family: monospace; font-size: 14px; margin: 20px 0; overflow: auto; padding: 20px; white-space: pre; white-space: pre-wrap; word-wrap: break-word; } blockquote, q { -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; } blockquote { font-size: 18px; font-style: italic; font-weight: 300; margin: 24px 40px; } blockquote blockquote { margin-right: 0; } blockquote cite, blockquote small { font-size: 14px; font-weight: normal; text-transform: uppercase; } blockquote em, blockquote i { font-style: normal; font-weight: 300; } blockquote strong, blockquote b { font-weight: 400; } small { font-size: smaller; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } dl { margin: 0 20px; } dt { font-weight: bold; } dd { margin: 0 0 20px; } menu, ol, ul { margin: 16px 0; padding: 0 0 0 40px; } ul { list-style-type: square; } nav ul, nav ol { list-style: none; list-style-image: none; } li > ul, li > ol { margin: 0; } img { -ms-interpolation-mode: bicubic; border: 0; vertical-align: middle; } svg:not(:root) { overflow: hidden; } figure { margin: 0; } form { margin: 0; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; white-space: normal; } button, input, select, textarea { font-size: 100%; margin: 0; max-width: 100%; vertical-align: baseline; } button, input { line-height: normal; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], input[disabled] { cursor: default; } input[type="checkbox"], input[type="radio"] { padding: 0; } input[type="search"] { -webkit-appearance: textfield; padding-right: 2px; /* Don't cut off the webkit search cancel button */ width: 270px; } input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } textarea { overflow: auto; vertical-align: top; } table { border-bottom: 1px solid #ededed; border-collapse: collapse; border-spacing: 0; font-size: 14px; line-height: 2; margin: 0 0 20px; width: 100%; } caption, th, td { font-weight: normal; text-align: left; } caption { font-size: 16px; margin: 20px 0; } th { font-weight: bold; text-transform: uppercase; } td { border-top: 1px solid #ededed; padding: 6px 10px 6px 0; } del { color: #333; } ins { background: #fff9c0; text-decoration: none; } hr { background: url(images/dotted-line.png) repeat center top; background-size: 4px 4px; border: 0; height: 1px; margin: 0 0 24px; } /** * 2.0 Repeatable Patterns * ---------------------------------------------------------------------------- */ .genericon:before, .menu-toggle:after, .featured-post:before, .date a:before, .entry-meta .author a:before, .format-audio .entry-content:before, .comments-link a:before, .tags-links a:first-child:before, .categories-links a:first-child:before, .edit-link a:before, .attachment .entry-title:before, .attachment-meta:before, .attachment-meta a:before, .comment-awaiting-moderation:before, .comment-reply-link:before, .comment-reply-login:before, .comment-reply-title small a:before, .bypostauthor > .comment-body .fn:before, .error404 .page-title:before { -webkit-font-smoothing: antialiased; display: inline-block; font: normal 16px/1 Genericons; vertical-align: text-bottom; } /* Clearing floats */ .clear:after, .attachment .entry-header:after, .site-footer .widget-area:after, .entry-content:after, .page-content:after, .navigation:after, .nav-links:after, .gallery:after, .comment-form-author:after, .comment-form-email:after, .comment-form-url:after, .comment-body:after { clear: both; } .clear:before, .clear:after, .attachment .entry-header:before, .attachment .entry-header:after, .site-footer .widget-area:before, .site-footer .widget-area:after, .entry-content:before, .entry-content:after, .page-content:before, .page-content:after, .navigation:before, .navigation:after, .nav-links:before, .nav-links:after, .gallery:before, .gallery:after, .comment-form-author:before, .comment-form-author:after, .comment-form-email:before, .comment-form-email:after, .comment-form-url:before, .comment-form-url:after, .comment-body:before, .comment-body:after { content: ""; display: table; } /* Assistive text */ .screen-reader-text { clip: rect(1px, 1px, 1px, 1px); position: absolute !important; } .screen-reader-text:focus { background-color: #f1f1f1; border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto !important; color: #21759b; display: block; font-size: 14px; font-weight: bold; height: auto; line-height: normal; padding: 15px 23px 14px; position: absolute; left: 5px; top: 5px; text-decoration: none; width: auto; z-index: 100000; /* Above WP toolbar */ } /* Form fields, general styles first. */ button, input, textarea { border: 2px solid #d4d0ba; font-family: inherit; padding: 5px; } input, textarea { color: #141412; } input:focus, textarea:focus { border: 2px solid #c3c0ab; outline: 0; } /* Buttons */ button, input[type="submit"], input[type="button"], input[type="reset"] { background: #e05d22; /* Old browsers */ background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome 10+, Safari 5.1+ */ background: linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */ border: none; border-bottom: 3px solid #b93207; border-radius: 2px; color: #fff; display: inline-block; padding: 11px 24px 10px; text-decoration: none; } button:hover, button:focus, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:focus, input[type="button"]:focus, input[type="reset"]:focus { background: #ed6a31; /* Old browsers */ background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome 10+, Safari 5.1+ */ background: linear-gradient(to bottom, #ed6a31 0%, #e55627 100%); /* W3C */ outline: none; } button:active, input[type="submit"]:active, input[type="button"]:active, input[type="reset"]:active { background: #d94412; /* Old browsers */ background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome 10+, Safari 5.1+ */ background: linear-gradient(to bottom, #d94412 0%, #e05d22 100%); /* W3C */ border: none; border-top: 3px solid #b93207; padding: 10px 24px 11px; } .post-password-required input[type="submit"] { padding: 7px 24px 4px; vertical-align: bottom; } .post-password-required input[type="submit"]:active { padding: 5px 24px 6px; } /* Placeholder text color -- selectors need to be separate to work. */ ::-webkit-input-placeholder { color: #7d7b6d; } :-moz-placeholder { color: #7d7b6d; } ::-moz-placeholder { color: #7d7b6d; } :-ms-input-placeholder { color: #7d7b6d; } /* * Responsive images * * Fluid images for posts, comments, and widgets */ .entry-content img, .entry-summary img, .comment-content img, .widget img, .wp-caption { max-width: 100%; } /* Make sure images with WordPress-added height and width attributes are scaled correctly. */ .entry-content img, .entry-summary img, .comment-content img[height], img[class*="align"], img[class*="wp-image-"], img[class*="attachment-"] { height: auto; } img.size-full, img.size-large, img.wp-post-image { height: auto; max-width: 100%; } /* Make sure videos and embeds fit their containers. */ embed, iframe, object, video { max-width: 100%; } /* Override the Twitter embed fixed width. */ .entry-content .twitter-tweet-rendered { max-width: 100% !important; } /* Images */ .alignleft { float: left; } .alignright { float: right; } .aligncenter { display: block; margin-left: auto; margin-right: auto; } figure.wp-caption.alignleft, img.alignleft { margin: 5px 20px 5px 0; } .wp-caption.alignleft { margin: 5px 10px 5px 0; } figure.wp-caption.alignright, img.alignright { margin: 5px 0 5px 20px; } .wp-caption.alignright { margin: 5px 0 5px 10px; } img.aligncenter { margin: 5px auto; } img.alignnone { margin: 5px 0; } .wp-caption .wp-caption-text, .entry-caption, .gallery-caption { color: #220e10; font-size: 18px; font-style: italic; font-weight: 300; margin: 0 0 24px; } div.wp-caption.alignright img[class*="wp-image-"] { float: right; } div.wp-caption.alignright .wp-caption-text { padding-left: 10px; } img.wp-smiley, .rsswidget img { border: 0; border-radius: 0; box-shadow: none; margin-bottom: 0; margin-top: 0; padding: 0; } .wp-caption.alignleft + ul, .wp-caption.alignleft + ol { list-style-position: inside; } /** * 3.0 Basic Structure * ---------------------------------------------------------------------------- */ .site { background-color: #fff; border-left: 1px solid #f2f2f2; border-right: 1px solid #f2f2f2; margin: 0 auto; max-width: 1600px; width: 100%; } .site-main { position: relative; } .site-main .sidebar-container { height: 0; position: absolute; top: 40px; width: 100%; z-index: 1; } .site-main .sidebar-inner { margin: 0 auto; max-width: 1040px; } /** * 4.0 Header * ---------------------------------------------------------------------------- */ /** * 4.1 Site Header * ---------------------------------------------------------------------------- */ .site-header { position: relative; } .site-header .home-link { color: #141412; display: block; margin: 0 auto; max-width: 1080px; min-height: 230px; padding: 0 20px; text-decoration: none; width: 100%; } .site-header .site-title:hover { text-decoration: underline; } .site-title { font-size: 60px; font-weight: bold; line-height: 1; margin: 0; padding: 58px 0 10px; } .site-description { font: 300 italic 24px "Source Sans Pro", Helvetica, sans-serif; margin: 0; } /** * 4.2 Navigation * ---------------------------------------------------------------------------- */ .main-navigation { clear: both; margin: 0 auto; max-width: 1080px; min-height: 45px; position: relative; } ul.nav-menu, div.nav-menu > ul { margin: 0; padding: 0 40px 0 0; } .nav-menu li { display: inline-block; position: relative; } .nav-menu li a { color: #141412; display: block; font-size: 15px; line-height: 1; padding: 15px 20px; text-decoration: none; } .nav-menu li:hover > a, .nav-menu li a:hover, .nav-menu li:focus > a, .nav-menu li a:focus { background-color: #220e10; color: #fff; } .nav-menu .sub-menu, .nav-menu .children { background-color: #220e10; border: 2px solid #f7f5e7; border-top: 0; padding: 0; position: absolute; left: -2px; z-index: 99999; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); } .nav-menu .sub-menu ul, .nav-menu .children ul { border-left: 0; left: 100%; top: 0; } ul.nav-menu ul a, .nav-menu ul ul a { color: #fff; margin: 0; width: 200px; } ul.nav-menu ul a:hover, .nav-menu ul ul a:hover, ul.nav-menu ul a:focus, .nav-menu ul ul a:focus { background-color: #db572f; } ul.nav-menu li:hover > ul, .nav-menu ul li:hover > ul, ul.nav-menu .focus > ul, .nav-menu .focus > ul { clip: inherit; overflow: inherit; height: inherit; width: inherit; } .nav-menu .current_page_item > a, .nav-menu .current_page_ancestor > a, .nav-menu .current-menu-item > a, .nav-menu .current-menu-ancestor > a { color: #bc360a; font-style: italic; } .menu-toggle { display: none; } /* Navbar */ .navbar { background-color: #f7f5e7; margin: 0 auto; max-width: 1600px; width: 100%; } .site-header .search-form { position: absolute; right: 20px; top: 1px; } .site-header .search-field { background-color: transparent; background-image: url(images/search-icon.png); background-position: 5px center; background-repeat: no-repeat; background-size: 24px 24px; border: none; cursor: pointer; height: 37px; margin: 3px 0; padding: 0 0 0 34px; position: relative; -webkit-transition: width 400ms ease, background 400ms ease; transition: width 400ms ease, background 400ms ease; width: 0; } .site-header .search-field:focus { background-color: #fff; border: 2px solid #c3c0ab; cursor: text; outline: 0; width: 230px; } /** * 5.0 Content * ---------------------------------------------------------------------------- */ .hentry { padding: 40px 0; } .entry-header, .entry-content, .entry-summary, .entry-meta { margin: 0 auto; max-width: 604px; width: 100%; } .sidebar .entry-header, .sidebar .entry-content, .sidebar .entry-summary, .sidebar .entry-meta { max-width: 1040px; padding: 0 376px 0 60px; } /** * 5.1 Entry Header * ---------------------------------------------------------------------------- */ .sidebar .entry-header .entry-meta { padding: 0; } .entry-thumbnail img { display: block; margin: 0 auto 10px; } .entry-header { margin-bottom: 30px; } .entry-title { font-weight: normal; margin: 0 0 5px; } .entry-title a { color: #141412; } .entry-title a:hover { color: #ea9629; } /** * 5.2 Entry Meta * ---------------------------------------------------------------------------- */ .entry-meta { clear: both; font-size: 14px; } .entry-meta a { color: #bc360a; } .entry-meta a:hover { color: #bc360a; } .entry-meta > span { margin-right: 20px; } .entry-meta > span:last-child { margin-right: 0; } .featured-post:before { content: "\f308"; margin-right: 2px; } .entry-meta .date a:before { content: "\f303"; } .comments-link a:before { content: "\f300"; margin-right: 2px; position: relative; top: -1px; } .entry-meta .author a:before { content: "\f304"; position: relative; top: -1px; } .categories-links a:first-child:before { content: "\f301"; } .tags-links a:first-child:before { content: "\f302"; position: relative; top: -1px; } .edit-link a:before { content: "\f411"; position: relative; top: -1px; } .single-author .entry-meta .author, .sticky.format-standard .entry-meta .date, .sticky.format-audio .entry-meta .date, .sticky.format-chat .entry-meta .date, .sticky.format-image .entry-meta .date, .sticky.format-gallery .entry-meta .date { display: none; } /** * 5.3 Entry Content * ---------------------------------------------------------------------------- */ .entry-content { -webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; hyphens: auto; word-wrap: break-word; } .entry-content a, .comment-content a { color: #bc360a; } .entry-content a:hover, .comment-content a:hover { color: #ea9629; } .entry-content blockquote { font-size: 24px; } .entry-content blockquote cite, .entry-content blockquote small { font-size: 16px; } .entry-content img.alignleft, .entry-content .wp-caption.alignleft { margin-left: -60px; } .entry-content img.alignright, .entry-content .wp-caption.alignright { margin-right: -60px; } footer.entry-meta { margin-top: 24px; } .format-standard footer.entry-meta { margin-top: 0; } /* Page links */ .page-links { clear: both; font-size: 16px; font-style: italic; font-weight: normal; line-height: 2.2; margin: 20px 0; text-transform: uppercase; } .page-links a, .page-links > span { background: #fff; border: 1px solid #fff; padding: 5px 10px; text-decoration: none; } .format-status .entry-content .page-links a, .format-gallery .entry-content .page-links a, .format-chat .entry-content .page-links a, .format-quote .entry-content .page-links a, .page-links a { background: #e63f2a; border: 1px solid #e63f2a; color: #fff; } .format-gallery .entry-content .page-links a:hover, .format-audio .entry-content .page-links a:hover, .format-status .entry-content .page-links a:hover, .format-video .entry-content .page-links a:hover, .format-chat .entry-content .page-links a:hover, .format-quote .entry-content .page-links a:hover, .page-links a:hover { background: #fff; color: #e63f2a; } .format-status .entry-content .page-links > span, .format-quote .entry-content .page-links > span { background: none; } .page-links .page-links-title { background: transparent; border: none; margin-right: 20px; padding: 0; } /* Mediaelements */ .hentry .mejs-mediaelement, .hentry .mejs-container .mejs-controls { background: #220e10; } .hentry .mejs-controls .mejs-time-rail .mejs-time-loaded, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { background: #fff; } .hentry .mejs-controls .mejs-time-rail .mejs-time-current { background: #ea9629; } .hentry .mejs-controls .mejs-time-rail .mejs-time-total, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { background: #595959; } .hentry .mejs-controls .mejs-time-rail span, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { border-radius: 0; } /** * 5.4 Galleries * ---------------------------------------------------------------------------- */ .gallery { margin-bottom: 20px; margin-left: -4px; } .gallery-item { float: left; margin: 0 4px 4px 0; overflow: hidden; position: relative; } .gallery-columns-1.gallery-size-medium, .gallery-columns-1.gallery-size-thumbnail, .gallery-columns-2.gallery-size-thumbnail, .gallery-columns-3.gallery-size-thumbnail { display: table; margin: 0 auto 20px; } .gallery-columns-1 .gallery-item, .gallery-columns-2 .gallery-item, .gallery-columns-3 .gallery-item { text-align: center; } .gallery-columns-4 .gallery-item { max-width: 23%; max-width: -webkit-calc(25% - 4px); max-width: calc(25% - 4px); } .gallery-columns-5 .gallery-item { max-width: 19%; max-width: -webkit-calc(20% - 4px); max-width: calc(20% - 4px); } .gallery-columns-6 .gallery-item { max-width: 15%; max-width: -webkit-calc(16.7% - 4px); max-width: calc(16.7% - 4px); } .gallery-columns-7 .gallery-item { max-width: 13%; max-width: -webkit-calc(14.28% - 4px); max-width: calc(14.28% - 4px); } .gallery-columns-8 .gallery-item { max-width: 11%; max-width: -webkit-calc(12.5% - 4px); max-width: calc(12.5% - 4px); } .gallery-columns-9 .gallery-item { max-width: 9%; max-width: -webkit-calc(11.1% - 4px); max-width: calc(11.1% - 4px); } .gallery-columns-1 .gallery-item:nth-of-type(1n), .gallery-columns-2 .gallery-item:nth-of-type(2n), .gallery-columns-3 .gallery-item:nth-of-type(3n), .gallery-columns-4 .gallery-item:nth-of-type(4n), .gallery-columns-5 .gallery-item:nth-of-type(5n), .gallery-columns-6 .gallery-item:nth-of-type(6n), .gallery-columns-7 .gallery-item:nth-of-type(7n), .gallery-columns-8 .gallery-item:nth-of-type(8n), .gallery-columns-9 .gallery-item:nth-of-type(9n) { margin-right: 0; } .gallery-columns-1.gallery-size-medium figure.gallery-item:nth-of-type(1n+1), .gallery-columns-1.gallery-size-thumbnail figure.gallery-item:nth-of-type(1n+1), .gallery-columns-2.gallery-size-thumbnail figure.gallery-item:nth-of-type(2n+1), .gallery-columns-3.gallery-size-thumbnail figure.gallery-item:nth-of-type(3n+1) { clear: left; } .gallery-caption { background-color: rgba(0, 0, 0, 0.7); box-sizing: border-box; color: #fff; font-size: 14px; line-height: 1.3; margin: 0; max-height: 50%; opacity: 0; padding: 2px 8px; position: absolute; bottom: 0; left: 0; text-align: left; -webkit-transition: opacity 400ms ease; transition: opacity 400ms ease; width: 100%; } .gallery-caption:before { box-shadow: 0 -10px 15px #000 inset; content: ""; height: 100%; min-height: 49px; position: absolute; left: 0; top: 0; width: 100%; } .gallery-item:hover .gallery-caption { opacity: 1; } .gallery-columns-7 .gallery-caption, .gallery-columns-8 .gallery-caption, .gallery-columns-9 .gallery-caption { display: none; } /** * 5.5 Post Formats * ---------------------------------------------------------------------------- */ /* Aside */ .format-aside { background-color: #f7f5e7; } .blog .format-aside:first-of-type, .single .format-aside:first-of-type, .format-aside + .format-aside, .format-aside + .format-link, .format-link + .format-aside { box-shadow: inset 0 2px 2px rgba(173, 165, 105, 0.2); } .format-aside .entry-meta { margin-top: 0; } .format-aside blockquote { font-size: 100%; font-weight: normal; } .format-aside cite { font-size: 100%; text-transform: none; } .format-aside cite:before { content: "\2014"; margin-right: 5px; } /* Audio */ .format-audio { background-color: #db572f; } .format-audio .entry-title { font-size: 28px; font-weight: bold; } .format-audio .entry-content:before { content: "\f109"; float: left; font-size: 64px; position: relative; top: 4px; } .format-audio .entry-content a, .format-audio .entry-meta a, .format-audio .entry-content a:hover, .format-audio .entry-meta a:hover { color: #fbfaf3; } .format-audio .audio-content { background: url(images/dotted-line.png) repeat-y left top; background-size: 4px 4px; float: right; padding-left: 35px; width: 80%; width: -webkit-calc(100% - 85px); width: calc(100% - 85px); } .format-audio .wp-audio-shortcode { height: 30px !important; /* Override mediaelement.js style */ margin: 20px 0; max-width: 400px !important; /* Override mediaelement.js style */ } .format-audio audio { max-width: 100% !important; /* Avoid player width overflow. */ } /* Chat */ .format-chat { background-color: #eadaa6; } .format-chat .entry-title { font-size: 28px; font-weight: bold; } .format-chat .entry-meta a, .format-chat .entry-content a { color: #722d19; } .format-chat .entry-meta .date a:before { content: "\f108"; margin-right: 2px; } .format-chat .entry-meta .author { display: none; } .format-chat .chat { margin: 0; } .format-chat .chat .chat-timestamp { color: #722d19; float: right; font-size: 12px; font-weight: normal; margin: 5px 10px 0; } .format-chat .chat .fn { font-style: normal; } /* Gallery */ .format-gallery { background-color: #fbca3c; } .format-gallery .entry-header { margin-bottom: 15px; } .format-gallery .entry-title { font-size: 50px; font-weight: 400; margin: 0; } .format-gallery .entry-meta a, .format-gallery .entry-content a { color: #722d19; } /* Image */ .format-image .entry-title { font-size: 28px; font-weight: bold; } .format-image .categories-links, .format-image .tags-links { display: none; } /* Link */ .format-link { background-color: #f7f5e7; } .blog .format-link:first-of-type, .single .format-link:first-of-type { box-shadow: inset 0 2px 2px rgba(173, 165, 105, 0.2); } .format-link .entry-header, .format-link .entry-content p:last-child { margin-bottom: 0; } .format-link .entry-title { color: #ca3c08; display: inline; font: 300 italic 20px "Source Sans Pro", Helvetica, sans-serif; margin-right: 20px; } .format-link .entry-title a { color: #bc360a; } .format-link div.entry-meta { display: inline; } /* Quote */ .format-quote { background-color: #210d10; } .format-quote .entry-content, .format-quote .entry-meta { color: #f7f5e7; } .format-quote .entry-content blockquote { font-size: 28px; margin: 0; } .format-quote .entry-content a, .format-quote .entry-meta a, .format-quote .linked { color: #e63f2a; } .format-quote .entry-content cite a { border-bottom: 1px dotted #fff; color: #fff; } .format-quote .entry-content cite a:hover { text-decoration: none; } .format-quote blockquote small, .format-quote blockquote cite { display: block; font-size: 16px; } .format-quote blockquote { font-style: italic; font-weight: 300; padding-left: 75px; position: relative; } .format-quote blockquote:before { content: '\201C'; font-size: 140px; font-weight: 400; line-height: .8; padding-right: 25px; position: absolute; left: -15px; top: -3px; } .format-quote .entry-meta .author { display: none; } /* Status */ .format-status { background-color: #722d19; padding: 0; } .format-status .entry-content, .format-status .entry-meta { padding-left: 35px; position: relative; } .format-status .entry-content a { color: #eadaa6; } .format-status .entry-meta a { color: #f7f5e7; } .sidebar .format-status .entry-content, .sidebar .format-status .entry-meta { padding-left: 95px; } .format-status .entry-content:before, .format-status .entry-meta:before { background: url(images/dotted-line.png) repeat-y left bottom; background-size: 4px 4px; content: ""; display: block; height: 100%; position: absolute; left: 10px; top: 0; width: 1px; } .sidebar .format-status .entry-content:before, .sidebar .format-status .entry-meta:before { left: 70px; } .format-status .categories-links, .format-status .tags-links { display: none; } /* Ensures the dots in the dot background are in lockstep. */ .format-status .entry-meta:before { background-position: left top; } .format-status .entry-content { color: #f7f5e7; font-size: 24px; font-style: italic; font-weight: 300; padding-bottom: 30px; padding-top: 40px; position: relative; } .format-status .entry-content p:first-child:before { background-color: rgba(0, 0, 0, 0.65); content: ""; height: 3px; margin-top: 13px; position: absolute; left: 4px; width: 13px; } .sidebar .format-status .entry-content > p:first-child:before { left: 64px; } .format-status .entry-content p:last-child { margin-bottom: 0; } .format-status .entry-meta { margin-top: 0; padding-bottom: 40px; } .format-status .entry-meta .date a:before { content: "\f105"; } /* Video */ .format-video { background-color: #db572f; } .format-video .entry-content a, .format-video .entry-meta a, .format-video .entry-content a:hover, .format-video .entry-meta a:hover { color: #fbfaf3; } .format-video .entry-title { font-size: 50px; font-weight: 400; } .format-video .entry-meta { color: #220e10; } /** * 5.6 Attachments * ---------------------------------------------------------------------------- */ .attachment .hentry { background-color: #e8e5ce; margin: 0; padding: 0; } .attachment .entry-header { margin-bottom: 0; max-width: 1040px; padding: 30px 0; } .attachment .entry-title { display: inline-block; float: left; font: 300 italic 30px "Source Sans Pro", Helvetica, sans-serif; margin: 0; } .attachment .entry-title:before { content: "\f416"; font-size: 32px; margin-right: 10px; } .attachment .entry-meta { clear: none; color: inherit; float: right; max-width: 604px; padding: 9px 0 0; text-align: right; } .hentry.attachment:not(.image-attachment) .entry-meta { max-width: 104px; } .attachment footer.entry-meta { display: none; } .attachment-meta:before { content: "\f307"; } .full-size-link a:before { content: "\f402"; } .full-size-link:before { content: none; } .attachment .entry-meta a, .attachment .entry-meta .edit-link:before, .attachment .full-size-link:before { color: #ca3c08; } .attachment .entry-content { background-color: #fff; max-width: 100%; padding: 40px 0; } .image-navigation { margin: 0 auto; max-width: 1040px; position: relative; } .image-navigation a:hover { text-decoration: none; } .image-navigation .nav-previous, .image-navigation .nav-next { position: absolute; top: 50px; } .image-navigation .nav-previous { left: 0; } .image-navigation .nav-next { right: 0; } .image-navigation .meta-nav { font-size: 32px; font-weight: 300; vertical-align: -4px; } .attachment .entry-attachment, .attachment .type-attachment p { margin: 0 auto; max-width: 724px; text-align: center; } .attachment .entry-attachment .attachment { display: inline-block; } .attachment .entry-caption { text-align: left; } .attachment .entry-description { margin: 20px auto 0; max-width: 604px; } .attachment .entry-caption p:last-child, .attachment .entry-description p:last-child { margin: 0; } .attachment .site-main .sidebar-container { display: none; } .attachment .entry-content .mejs-audio { max-width: 400px; margin: 0 auto; } .attachment .entry-content .wp-video { margin: 0 auto; } .attachment .entry-content .mejs-container { margin-bottom: 24px; } /** * 5.7 Post/Paging Navigation * ---------------------------------------------------------------------------- */ .navigation .nav-previous { float: left; } .navigation .nav-next { float: right; } .navigation a { color: #bc360a; } .navigation a:hover { color: #ea9629; text-decoration: none; } .paging-navigation { background-color: #e8e5ce; padding: 40px 0; } .paging-navigation .nav-links { margin: 0 auto; max-width: 604px; width: 100%; } .sidebar .paging-navigation .nav-links { max-width: 1040px; padding: 0 376px 0 60px; } .paging-navigation .nav-next { padding: 13px 0; } .paging-navigation a { font-size: 22px; font-style: italic; font-weight: 300; } .paging-navigation .meta-nav { background-color: #e63f2a; border-radius: 50%; color: #fff; display: inline-block; font-size: 26px; padding: 3px 0 8px; text-align: center; width: 50px; } .paging-navigation .nav-previous .meta-nav { margin-right: 10px; padding: 17px 0 23px; width: 80px; } .paging-navigation .nav-next .meta-nav { margin-left: 10px; } .paging-navigation a:hover .meta-nav { background-color: #ea9629; text-decoration: none; } .post-navigation { background-color: #fff; color: #ca3c08; font-size: 20px; font-style: italic; font-weight: 300; padding: 20px 0; } .post-navigation .nav-links { margin: 0 auto; max-width: 1040px; } .sidebar .post-navigation .nav-links { padding: 0 376px 0 60px; } .post-navigation a[rel="next"] { float: right; text-align: right; } /** * 5.8 Author Bio * ---------------------------------------------------------------------------- */ .author-info { margin: 0 auto; max-width: 604px; padding: 30px 0 10px; text-align: left; /* gallery & video post formats */ width: 100%; } .author.sidebar .author-info { max-width: 1040px; padding: 30px 376px 10px 60px; } .single .author-info { padding: 50px 0 0; } .author-avatar .avatar { float: left; margin: 0 30px 30px 0; } .single-format-status .author-description { color: #f7f5e7; } .author-description .author-title { clear: none; font: 300 italic 20px "Source Sans Pro", Helvetica, sans-serif; margin: 0 0 8px; } .author-link { color: #ca3c08; margin-left: 2px; } .author.archive .author-link { display: none; } /** * 5.9 Archives * ---------------------------------------------------------------------------- */ .archive-header { background-color: #e8e5ce; } .archive-title, .archive-meta { font: 300 italic 30px "Source Sans Pro", Helvetica, sans-serif; margin: 0 auto; max-width: 1040px; padding: 30px 0; width: 100%; } .archive-meta { font-size: 16px; font-style: normal; font-weight: normal; margin-top: -15px; padding: 0 0 11px; } .sidebar .archive-meta { padding-right: 316px; } /** * 5.10 Search Results/No posts * ---------------------------------------------------------------------------- */ .page-header { background-color: #e8e5ce; } .page-title { font: 300 italic 30px "Source Sans Pro", Helvetica, sans-serif; margin: 0 auto; max-width: 1040px; padding: 30px 0; width: 100%; } .page-content { margin: 0 auto; max-width: 604px; padding: 40px 0; width: 100%; } .sidebar .page-content { margin: 0 auto; max-width: 1040px; padding: 40px 376px 40px 60px; } /** * 5.11 404 * ---------------------------------------------------------------------------- */ .error404 .page-header { background-color: #fff; } .error404 .page-title { line-height: 0.6; margin: 0; padding: 300px; position: relative; text-align: center; width: auto; } .error404 .page-title:before { color: #e8e5ce; content: "\f423"; font-size: 964px; line-height: 0.6; overflow: hidden; position: absolute; left: 7px; top: 28px; } .error404 .page-wrapper { background-color: #e8e5ce; } .error404 .page-header, .error404 .page-content { margin: 0 auto; max-width: 1040px; padding-bottom: 40px; width: 100%; } /** * 5.12 Comments * ---------------------------------------------------------------------------- */ .comments-title, .comment-list, .comment-reply-title, .must-log-in, .comment-respond .comment-form, .comment-respond iframe { display: block; margin-left: auto; margin-right: auto; max-width: 604px; width: 100%; } .sidebar .comments-title, .sidebar .comment-list, .sidebar .must-log-in, .sidebar .comment-reply-title, .sidebar .comment-navigation, .sidebar .comment-respond .comment-form { max-width: 1040px; padding-left: 60px; padding-right: 376px; } .comments-title { font: 300 italic 28px "Source Sans Pro", Helvetica, sans-serif; } .comment-list, .comment-list .children { list-style-type: none; padding: 0; } .comment-list .children { margin-left: 20px; } .comment-list > li:after, .comment-list .children > li:before { background: url(images/dotted-line.png) repeat left top; background-size: 4px 4px; content: ""; display: block; height: 1px; width: 100%; } .comment-list > li:last-child:after { display: none; } .comment-body { padding: 24px 0; position: relative; } .comment-author { float: left; max-width: 74px; } .comment-author .avatar { display: block; margin-bottom: 10px; } .comment-author .fn { word-wrap: break-word; } .comment-author .fn, .comment-author .url, .comment-reply-link, .comment-reply-login { color: #bc360a; font-size: 14px; font-style: normal; font-weight: normal; } .says { display: none; } .no-avatars .comment-author { margin: 0 0 5px; max-width: 100%; position: relative; } .no-avatars .comment-metadata, .no-avatars .comment-content, .no-avatars .comment-list .reply { width: 100%; } .bypostauthor > .comment-body .fn:before { content: "\f408"; vertical-align: text-top; } .comment-list .edit-link { margin-left: 20px; } .comment-metadata, .comment-awaiting-moderation, .comment-content, .comment-list .reply { float: right; width: 79%; width: -webkit-calc(100% - 124px); width: calc(100% - 124px); word-wrap: break-word; } .comment-meta, .comment-meta a { color: #a2a2a2; font-size: 13px; } .comment-meta a:hover { color: #ea9629; } .comment-metadata { margin-bottom: 20px; } .ping-meta { color: #a2a2a2; font-size: 13px; line-height: 2; } .comment-awaiting-moderation { color: #a2a2a2; } .comment-awaiting-moderation:before { content: "\f414"; margin-right: 5px; position: relative; top: -2px; } .comment-reply-link:before, .comment-reply-login:before { content: "\f412"; margin-right: 3px; } /* Comment form */ .comment-respond { background-color: #f7f5e7; padding: 30px 0; } .comment .comment-respond { margin-bottom: 20px; padding: 20px; } .comment-reply-title { font: 300 italic 28px "Source Sans Pro", Helvetica, sans-serif; } .comment-reply-title small a { color: #131310; display: inline-block; float: right; height: 16px; overflow: hidden; width: 16px; } .comment-reply-title small a:hover { color: #ed331c; text-decoration: none; } .comment-reply-title small a:before { content: "\f406"; vertical-align: top; } .sidebar .comment-list .comment-reply-title, .sidebar .comment-list .comment-respond .comment-form { padding: 0; } .comment-form .comment-notes { margin-bottom: 15px; } .comment-form .comment-form-author, .comment-form .comment-form-email, .comment-form .comment-form-url { margin-bottom: 8px; } .comment-form [for="author"], .comment-form [for="email"], .comment-form [for="url"], .comment-form [for="comment"] { float: left; padding: 5px 0; width: 120px; } .comment-form .required { color: #ed331c; } .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"] { max-width: 270px; width: 60%; } .comment-form textarea { width: 100%; } .form-allowed-tags, .form-allowed-tags code { color: #686758; font-size: 12px; } .form-allowed-tags code { font-size: 10px; margin-left: 3px; } .comment-list .pingback, .comment-list .trackback { padding-top: 24px; } .comment-navigation { font-size: 20px; font-style: italic; font-weight: 300; margin: 0 auto; max-width: 604px; padding: 20px 0 30px; width: 100%; } .no-comments { background-color: #f7f5e7; font-size: 20px; font-style: italic; font-weight: 300; margin: 0; padding: 40px 0; text-align: center; } .sidebar .no-comments { padding-left: 60px; padding-right: 376px; } /** * 5.13 Multisite * ---------------------------------------------------------------------------- */ .site-main .mu_register { margin: 0 auto; max-width: 604px; width: 100%; } .mu_alert { margin-top: 25px; } .site-main .mu_register input[type="submit"], .site-main .mu_register #blog_title, .site-main .mu_register #user_email, .site-main .mu_register #blogname, .site-main .mu_register #user_name { font-size: inherit; width: 270px; } .site-main .mu_register input[type="submit"] { width: auto; } /** * 6.0 Sidebar * ---------------------------------------------------------------------------- */ .site-main .widget-area { float: right; width: 300px; } /** * 6.1 Widgets * ---------------------------------------------------------------------------- */ .widget { background-color: rgba(247, 245, 231, 0.7); font-size: 14px; -webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; hyphens: auto; margin: 0 0 24px; padding: 20px; word-wrap: break-word; } .widget .widget-title { font: 300 italic 20px "Source Sans Pro", Helvetica, sans-serif; margin: 0 0 10px; } .widget ul, .widget ol { list-style-type: none; margin: 0; padding: 0; } .widget li { padding: 5px 0; } .widget .children li:last-child { padding-bottom: 0; } .widget li > ul, .widget li > ol { margin-left: 20px; } .widget a { color: #bc360a; } .widget a:hover { color: #ea9629; } /* Search widget */ .search-form .search-submit { display: none; } /* RSS Widget */ .widget_rss .rss-date { display: block; } .widget_rss .rss-date, .widget_rss li > cite { color: #a2a2a2; } /* Calendar Widget */ .widget_calendar table, .widget_calendar td { border: 0; border-collapse: separate; border-spacing: 1px; } .widget_calendar caption { font-size: 14px; margin: 0; } .widget_calendar th, .widget_calendar td { padding: 0; text-align: center; } .widget_calendar a { display: block; } .widget_calendar a:hover { background-color: rgba(0, 0, 0, 0.15); } .widget_calendar tbody td { background-color: rgba(255, 255, 255, 0.5); } .site-footer .widget_calendar tbody td { background-color: rgba(255, 255, 255, 0.05); } .widget_calendar tbody .pad, .site-footer .widget_calendar tbody .pad { background-color: transparent; } /** * 7.0 Footer * ---------------------------------------------------------------------------- */ .site-footer { background-color: #e8e5ce; color: #686758; font-size: 14px; text-align: center; } .site-footer .widget-area, .sidebar .site-footer { text-align: left; } .site-footer a { color: #686758; } .site-footer .sidebar-container { background-color: #220e10; padding: 20px 0; } .site-footer .widget-area { margin: 0 auto; max-width: 1040px; width: 100%; } .sidebar .site-footer .widget-area { max-width: 724px; position: relative; left: -158px; } .site-footer .widget { background: transparent; color: #fff; float: left; margin-right: 20px; width: 245px; } .sidebar .site-footer .widget { width: 228px; } .sidebar .site-footer .widget:nth-of-type(4), .sidebar .site-footer .widget:nth-of-type(3) { margin-right: 0; } .site-footer .widget a { color: #e6402a; } .site-footer .widget-title, .site-footer .widget-title a, .site-footer .wp-caption-text { color: #fff; } .site-info { margin: 0 auto; max-width: 1040px; padding: 30px 0; width: 100%; } #wpstats { display: block; margin: -10px auto 0; } /** * 8.0 Media Queries * ---------------------------------------------------------------------------- */ /* Does the same thing as <meta name="viewport" content="width=device-width">, * but in the future W3C standard way. -ms- prefix is required for IE10+ to * render responsive styling in Windows 8 "snapped" views; IE10+ does not honor * the meta tag. See http://core.trac.wordpress.org/ticket/25888. */ @-ms-viewport { width: device-width; } @viewport { width: device-width; } @media (max-width: 1599px) { .site { border: 0; } } @media (max-width: 1069px) { .sidebar img.alignleft, .sidebar .wp-caption.alignleft { margin-left: 0; } .sidebar img.alignright, .sidebar .wp-caption.alignright { margin-right: 0; } .error404 .page-header { margin-left: auto; max-width: 604px; width: 100%; } .archive-header, .search .page-header, .archive .page-header, .blog .page-header, .error404 .page-content, .search .page-content, .archive .page-content, .attachment .entry-header, .attachment .entry-content, .post-navigation .nav-links, .sidebar .site-info, .site-footer .widget-area { padding-left: 20px; padding-right: 20px; } .error404 .page-title { font-size: 24px; padding: 180px; } .error404 .page-title:before { font-size: 554px; } .attachment .image-navigation { max-width: 724px; } .image-navigation .nav-previous, .image-navigation .nav-next { position: static; } .site-main .widget-area { margin-right: 60px; } } @media (max-width: 999px) { .sidebar .entry-header, .sidebar .entry-content, .sidebar .entry-summary, .sidebar .entry-meta, .sidebar .comment-list, .sidebar .comment-reply-title, .sidebar .comment-navigation, .sidebar .comment-respond .comment-form, .sidebar .featured-gallery, .sidebar .post-navigation .nav-links, .author.sidebar .author-info { max-width: 604px; padding-left: 0; padding-right: 0; } .sidebar .site-info, .search.sidebar .page-content, .blog.sidebar .page-content, .attachment .entry-header, .sidebar .comments-title { max-width: 604px; } .sidebar .archive-meta, .attachment .entry-header, .search.sidebar .page-content, .blog.sidebar .page-content, .sidebar .site-info, .sidebar .comments-title, .sidebar .no-comments { padding-left: 0; padding-right: 0; } .attachment .entry-meta { float: left; text-align: left; width: 100%; } .attachment .entry-content { max-width: 100%; padding: 40px 0; } .format-status .entry-content { padding-top: 40px; } .format-status .entry-meta { padding-bottom: 40px; } .sidebar .format-status .entry-content, .sidebar .format-status .entry-meta { padding-left: 35px; } .sidebar .format-status .entry-content:before, .sidebar .format-status .entry-meta:before { left: 10px; } .sidebar .format-status .entry-content p:first-child:before { left: 4px; } .sidebar .paging-navigation .nav-links { padding: 0 60px; } .site-main .sidebar-container { height: auto; margin: 0 auto; max-width: 604px; position: relative; top: 20px; } .site-main .widget-area { float: none; margin: 0; width: 100%; } .sidebar .site-footer .widget-area { max-width: 100%; left: 0; } } /* Collapse oversized image and pulled images after iPad breakpoint. */ @media (max-width: 767px) { .entry-content img.alignleft, .entry-content .wp-caption.alignleft { margin-left: 0; } .entry-content img.alignright, .entry-content .wp-caption.alignright { margin-right: 0; } .attachment .image-navigation, .attachment .entry-attachment .attachment { max-width: 604px; padding: 0; width: 100%; } .gallery-caption { display: none; } } @media (max-width: 643px) { .site-title { font-size: 30px; } #content .entry-header, #content .entry-content, #content .entry-summary, #content footer.entry-meta, #content .featured-gallery, .search.sidebar .page-content, .blog.sidebar .page-content, .sidebar .post-navigation .nav-links, .paging-navigation .nav-links, #content .author-info, .comments-area .comments-title, .comments-area .comment-list, .comments-area .comment-navigation, .comment-respond, .sidebar .site-info, .sidebar .paging-navigation .nav-links { padding-left: 20px; padding-right: 20px; } #content .format-status .entry-content, #content .format-status .entry-met { padding-left: 35px; } /* Small menu */ .menu-toggle { cursor: pointer; display: inline-block; font: bold 16px/1.3 "Source Sans Pro", Helvetica, sans-serif; margin: 0; padding: 12px 0 12px 20px; } .menu-toggle:after { content: "\f502"; font-size: 12px; padding-left: 8px; vertical-align: -4px; } .toggled-on .menu-toggle:after { content: "\f500"; vertical-align: 2px; } .toggled-on .nav-menu, .toggled-on .nav-menu > ul { display: block; margin-left: 0; padding: 0; width: 100%; } .toggled-on li, .toggled-on .children { display: block; } .toggled-on .nav-menu li > ul { background-color: transparent; display: block; float: none; margin-left: 20px; position: relative; left: auto; top: auto; } .toggled-on .nav-menu li > ul a { color: #141412; width: auto; } .toggled-on .nav-menu li:hover > a, .toggled-on .nav-menu .children a { background-color: transparent; color: #141412; } .toggled-on .nav-menu li a:hover, .toggled-on .nav-menu ul a:hover { background-color: #db572f; color: #fff; } ul.nav-menu, div.nav-menu > ul { display: none; } #content .featured-gallery { padding-left: 24px; } .gallery-columns-1 .gallery-item { margin-right: 0; width: 100%; } .entry-title, .format-chat .entry-title, .format-image .entry-title, .format-gallery .entry-title, .format-video .entry-title { font-size: 22px; font-weight: bold; } .format-quote blockquote, .format-status .entry-content { font-size: 18px; } .format-quote blockquote small, .format-quote blockquote cite { font-size: 13px; } .error404 .page-title { padding: 40px 0 0; } .error404 .page-title:before { content: normal; } .comment-author { margin-right: 30px; } .comment-author .avatar { height: auto; max-width: 100%; } .comment-metadata, .comment-content, .comment-list .reply { width: 70%; width: -webkit-calc(100% - 104px); width: calc(100% - 104px); } .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"] { width: -webkit-calc(100% - 120px); width: calc(100% - 120px); } .comment-form textarea { height: 80px; /* Smaller field for mobile. */ } /* Audio */ .format-audio .entry-content:before { display: none; } .format-audio .audio-content { background-image: none; float: none; padding-left: 0; width: auto; } } /* Mobile devices */ @media (max-width: 359px) { .gallery { margin-left: 0; } .gallery .gallery-item, .gallery-columns-2.gallery-size-thumbnail .gallery-item { max-width: none; width: 49%; width: -webkit-calc(50% - 4px); width: calc(50% - 4px); } .gallery-columns-1.gallery-size-medium, .gallery-columns-1.gallery-size-thumbnail, .gallery-columns-2.gallery-size-thumbnail, .gallery-columns-3.gallery-size-thumbnail { display: block; } .gallery-columns-1 .gallery-item, .gallery-columns-1.gallery-size-medium .gallery-item, .gallery-columns-1.gallery-size-thumbnail .gallery-item { text-align: center; width: 98%; width: -webkit-calc(100% - 4px); width: calc(100% - 4px); } .gallery-columns-3 .gallery-item:nth-of-type(3n), .gallery-columns-5 .gallery-item:nth-of-type(5n), .gallery-columns-7 .gallery-item:nth-of-type(7n), .gallery-columns-9 .gallery-item:nth-of-type(9n) { margin-right: 4px; } .gallery br { display: none; } .gallery .gallery-item:nth-of-type(even) { margin-right: 0; } /* Comments */ .comment-author { margin: 0 0 5px; max-width: 100%; } .comment-author .avatar { display: inline; margin: 0 5px 0 0; max-width: 20px; } .comment-metadata, .comment-content, .comment-list .reply { width: 100%; } } /** * 9.0 Print * ---------------------------------------------------------------------------- */ /* Retina-specific styles. */ @media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) { .site-header .search-field { background-image: url(images/search-icon-2x.png); } .format-audio .audio-content, .format-status .entry-content:before, .format-status .entry-meta:before, .comment-list > li:after, .comment-list .children > li:before { background-image: url(images/dotted-line-2x.png); } } @media print { body { background: none !important; color: #000; font-size: 10pt; } footer a[rel="bookmark"]:link:after, footer a[rel="bookmark"]:visited:after { content: " [" attr(href) "] "; /* Show URLs */ } .site { max-width: 98%; } .site-header { background-image: none !important; } .site-header .home-link { max-width: none; min-height: 0; } .site-title { color: #000; font-size: 21pt; } .site-description { font-size: 10pt; } .author-avatar, .site-footer, .comment-respond, .comments-area .comment-edit-link, .comments-area .reply, .comments-link, .entry-meta .edit-link, .page-links, .site-content nav, .widget-area, .main-navigation, .navbar, .more-link { display: none; } .entry-header, .entry-content, .entry-summary, .entry-meta { margin: 0; width: 100%; } .page-title, .entry-title { font-size: 21pt; } .entry-meta, .entry-meta a { color: #444; font-size: 10pt; } .entry-content img.alignleft, .entry-content .wp-caption.alignleft { margin-left: 0; } .entry-content img.alignright, .entry-content .wp-caption.alignright { margin-right: 0; } .format-image .entry-content .size-full { margin: 0; } /* Remove colors from post formats */ .hentry { background-color: #fff; } /* Comments */ .comments-area > li.comment { background: none; position: relative; width: auto; } .comment-metadata { float: none; } .comment-author .fn, .comment-reply-link, .comment-reply-login { color: #333; } }
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/style.css
CSS
gpl3
53,712
<?php /** * The sidebar containing the secondary widget area * * Displays on posts and pages. * * If no active widgets are in this sidebar, hide it completely. * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ if ( is_active_sidebar( 'sidebar-2' ) ) : ?> <div id="tertiary" class="sidebar-container" role="complementary"> <div class="sidebar-inner"> <div class="widget-area"> <?php dynamic_sidebar( 'sidebar-2' ); ?> </div><!-- .widget-area --> </div><!-- .sidebar-inner --> </div><!-- #tertiary --> <?php endif; ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/sidebar.php
PHP
gpl3
577
<?php /** * The template for displaying 404 pages (Not Found) * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <header class="page-header"> <h1 class="page-title"><?php _e( 'Not Found', 'twentythirteen' ); ?></h1> </header> <div class="page-wrapper"> <div class="page-content"> <h2><?php _e( 'This is somewhat embarrassing, isn&rsquo;t it?', 'twentythirteen' ); ?></h2> <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentythirteen' ); ?></p> <?php get_search_form(); ?> </div><!-- .page-content --> </div><!-- .page-wrapper --> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/404.php
PHP
gpl3
842
<?php /** * The template for displaying a "No posts found" message * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <header class="page-header"> <h1 class="page-title"><?php _e( 'Nothing Found', 'twentythirteen' ); ?></h1> </header> <div class="page-content"> <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentythirteen' ), admin_url( 'post-new.php' ) ); ?></p> <?php elseif ( is_search() ) : ?> <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with different keywords.', 'twentythirteen' ); ?></p> <?php get_search_form(); ?> <?php else : ?> <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentythirteen' ); ?></p> <?php get_search_form(); ?> <?php endif; ?> </div><!-- .page-content -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-none.php
PHP
gpl3
956
<?php /** * The template for displaying posts in the Chat post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> <?php endif; // is_single() ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-chat.php
PHP
gpl3
1,085
/* Theme Name: Twenty Thirteen Description: Used to style the TinyMCE editor. */ /** * Table of Contents: * * 1.0 - Body * 2.0 - Headings * 3.0 - Text Elements * 4.0 - Links * 5.0 - Alignment * 6.0 - Tables * 7.0 - Images * 8.0 - Galleries * 9.0 - Audio/Video * 10.0 - Post Formats * 11.0 - RTL * ---------------------------------------------------------------------------- */ /** * 1.0 Body * ---------------------------------------------------------------------------- */ html .mceContentBody { font-size: 100%; max-width: 604px; } body { color: #141412; font-family: "Source Sans Pro", Helvetica, sans-serif; line-height: 1.5; text-rendering: optimizeLegibility; vertical-align: baseline; } /** * 2.0 Headings * ---------------------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { clear: both; font-family: Bitter, Georgia, serif; line-height: 1.3; } h1 { font-size: 48px; margin: 33px 0; } h2 { font-size: 30px; margin: 25px 0; } h3 { font-size: 22px; margin: 22px 0; } h4 { font-size: 20px; margin: 25px 0; } h5 { font-size: 18px; margin: 30px 0; } h6 { font-size: 16px; margin: 36px 0; } hr { background: url(../images/dotted-line.png) repeat center top; background-size: 4px 4px; border: 0; height: 1px; margin: 0 0 24px; } /** * 3.0 Text Elements * ---------------------------------------------------------------------------- */ p { margin: 0 0 24px; } ol, ul { margin: 16px 0; padding: 0 0 0 40px; } ul { list-style-type: square; } ol { list-style: decimal outside; } li > ul, li > ol { margin: 0; } dl { margin: 0 20px; } dt { font-weight: bold; } dd { margin: 0 0 20px; } strong { font-weight: bold; } code, kbd, pre, samp { font-family: monospace, serif; font-size: 14px; } pre { background: #f5f5f5; color: #666; font-family: monospace; font-size: 14px; margin: 20px 0; overflow: auto; padding: 20px; white-space: pre; white-space: pre-wrap; word-wrap: break-word; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; } blockquote { font-size: 24px; font-style: italic; font-weight: 300; margin: 24px 40px; } blockquote blockquote { margin-right: 0; } blockquote cite, blockquote small { font-size: 14px; font-weight: normal; text-transform: uppercase; } cite { border-bottom: 0; } abbr[title] { border-bottom: 1px dotted; } address { font-style: italic; margin: 0 0 24px; } del { color: #333; } ins { background: #fff9c0; border: none; color: #333; text-decoration: none; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } /** * 4.0 Links * ---------------------------------------------------------------------------- */ a { color: #ca3c08; text-decoration: none; } a:visited { color: #ac0404; } a:focus { outline: thin dotted; } a:active, a:hover { color: #ea9629; outline: 0; } a:hover { text-decoration: underline; } /** * 5.0 Alignment * ---------------------------------------------------------------------------- */ .alignleft { float: left; margin: 5px 20px 5px 0; } .alignright { float: right; margin: 5px 0 5px 20px; } .aligncenter { display: block; margin: 5px auto; } img.alignnone { margin: 5px 0; } /** * 6.0 Tables * ---------------------------------------------------------------------------- */ table { border-bottom: 1px solid #ededed; border-collapse: collapse; border-spacing: 0; font-size: 14px; line-height: 2; margin: 0 0 20px; width: 100%; } caption, th, td { font-weight: normal; text-align: left; } caption { font-size: 16px; margin: 20px 0; } th { font-weight: bold; text-transform: uppercase; } td { border-top: 1px solid #ededed; padding: 6px 10px 6px 0; } /** * 7.0 Images * ---------------------------------------------------------------------------- */ img { height: auto; max-width: 100%; vertical-align: middle; } .wp-caption { background: transparent; border: none; margin: 0; padding: 0; text-align: left; } .html5-captions .wp-caption { padding: 0; } .wp-caption.alignleft { margin: 5px 10px 5px 0; } .html5-captions .wp-caption.alignleft { margin-right: 20px; } .wp-caption.alignright { margin: 5px 0 5px 10px; } .wp-caption.alignright img, .wp-caption.alignright .wp-caption-dd { padding-left: 10px; } .html5-captions .wp-caption.alignright { margin-left: 20px; } .html5-captions .wp-caption.alignright img, .html5-captions .wp-caption.alignright .wp-caption-dd { padding: 0; } .wp-caption-dt { margin: 0; } .wp-caption .wp-caption-text, .wp-caption-dd { color: #220e10; font-size: 18px; font-style: italic; font-weight: 300; line-height: 1.5; margin-bottom: 24px; padding: 0; } .mceTemp + ul, .mceTemp + ol { list-style-position: inside; } /** * 8.0 Galleries * ---------------------------------------------------------------------------- */ .gallery .gallery-item { float: left; margin: 0 4px 4px 0; overflow: hidden; padding: 0; position: relative; } .gallery-columns-1 .gallery-item { max-width: 100%; width: auto; } .gallery-columns-2 .gallery-item { max-width: 48%; max-width: -webkit-calc(50% - 14px); max-width: calc(50% - 14px); width: auto; } .gallery-columns-3 .gallery-item { max-width: 32%; max-width: -webkit-calc(33.3% - 11px); max-width: calc(33.3% - 11px); width: auto; } .gallery-columns-4 .gallery-item { max-width: 23%; max-width: -webkit-calc(25% - 9px); max-width: calc(25% - 9px); width: auto; } .gallery-columns-5 .gallery-item { max-width: 19%; max-width: -webkit-calc(20% - 8px); max-width: calc(20% - 8px); width: auto; } .gallery-columns-6 .gallery-item { max-width: 15%; max-width: -webkit-calc(16.7% - 7px); max-width: calc(16.7% - 7px); width: auto; } .gallery-columns-7 .gallery-item { max-width: 13%; max-width: -webkit-calc(14.28% - 7px); max-width: calc(14.28% - 7px); width: auto; } .gallery-columns-8 .gallery-item { max-width: 11%; max-width: -webkit-calc(12.5% - 6px); max-width: calc(12.5% - 6px); width: auto; } .gallery-columns-9 .gallery-item { max-width: 9%; max-width: -webkit-calc(11.1% - 6px); max-width: calc(11.1% - 6px); width: auto; } .gallery-columns-1 .gallery-item:nth-of-type(1n), .gallery-columns-2 .gallery-item:nth-of-type(2n), .gallery-columns-3 .gallery-item:nth-of-type(3n), .gallery-columns-4 .gallery-item:nth-of-type(4n), .gallery-columns-5 .gallery-item:nth-of-type(5n), .gallery-columns-6 .gallery-item:nth-of-type(6n), .gallery-columns-7 .gallery-item:nth-of-type(7n), .gallery-columns-8 .gallery-item:nth-of-type(8n), .gallery-columns-9 .gallery-item:nth-of-type(9n) { margin-right: 0; } .gallery-columns-1 .gallery-item:nth-of-type(1n), .gallery-columns-2 .gallery-item:nth-of-type(2n - 1), .gallery-columns-3 .gallery-item:nth-of-type(3n - 2), .gallery-columns-4 .gallery-item:nth-of-type(4n - 3), .gallery-columns-5 .gallery-item:nth-of-type(5n - 4), .gallery-columns-6 .gallery-item:nth-of-type(6n - 5), .gallery-columns-7 .gallery-item:nth-of-type(7n - 6), .gallery-columns-8 .gallery-item:nth-of-type(8n - 7), .gallery-columns-9 .gallery-item:nth-of-type(9n - 8) { margin-left: 12px; /* Compensate for the default negative margin on .gallery, which can't be changed. */ } .gallery .gallery-caption { background-color: rgba(0, 0, 0, 0.7); box-sizing: border-box; color: #fff; font-size: 14px; line-height: 1.3; margin: 0; max-height: 50%; opacity: 0; padding: 2px 8px; position: absolute; bottom: 0; left: 0; text-align: left; -webkit-transition: opacity 400ms ease; transition: opacity 400ms ease; width: 100%; } .gallery .gallery-caption:before { box-shadow: 0 -10px 15px #000 inset; content: ""; height: 100%; min-height: 49px; position: absolute; left: 0; top: 0; width: 100%; } .gallery-item:hover .gallery-caption { opacity: 1; } .gallery-columns-7 .gallery-caption, .gallery-columns-8 .gallery-caption, .gallery-columns-9 .gallery-caption { display: none; } /** * 9.0 Audio/Video * ---------------------------------------------------------------------------- */ .mejs-mediaelement, .mejs-container .mejs-controls { background: #220e10; } .mejs-controls .mejs-time-rail .mejs-time-loaded, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { background: #fff; } .mejs-controls .mejs-time-rail .mejs-time-current { background: #ea9629; } .mejs-controls .mejs-time-rail .mejs-time-total, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { background: #595959; } .mejs-controls .mejs-time-rail span, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { border-radius: 0; } /** * 10.0 Post Formats * ---------------------------------------------------------------------------- */ /* Aside */ .post-format-aside { background-color: #f7f5e7; } .post-format-aside blockquote { font-size: 100%; font-weight: normal; } .post-format-aside cite { font-size: 100%; text-transform: none; } .post-format-aside cite:before { content: "\2014"; margin-right: 5px; } /* Audio */ .post-format-audio { background-color: #db572f; } .post-format-audio a { color: #fbfaf3; } .post-format-audio:before { background: url(../images/dotted-line.png) repeat-y 85px 0; background-size: 4px 4px; content: "\f109"; display: block; float: left; font-family: Genericons; font-size: 64px; -webkit-font-smoothing: antialiased; height: 100%; line-height: 1; width: 120px; } /* Chat */ .post-format-chat { background-color: #eadaa6; } .post-format-chat a { color: #722d19; } /* Gallery */ .post-format-gallery { background-color: #fbca3c; } .post-format-gallery a { color: #722d19; } /* Image: same as Standard/Defaults */ /* Link */ .post-format-link { background-color: #f7f5e7; } /* Quote */ .post-format-quote { background-color: #210d10; color: #f7f5e7; } .post-format-quote a { color: #e63f2a; } .post-format-quote blockquote { font-size: 28px; font-style: italic; font-weight: 300; margin: 0; padding-left: 75px; position: relative; } .post-format-quote blockquote:before { content: '\201C'; font-size: 140px; font-weight: 400; line-height: .8; padding-right: 25px; position: absolute; left: -15px; top: -3px; } .post-format-quote blockquote small, .post-format-quote blockquote cite { display: block; font-size: 16px; } .format-quote .entry-content cite a { border-bottom: 1px dotted #fff; color: #fff; } .format-quote .entry-content cite a:hover { text-decoration: none; } /* Status */ .post-format-status { background-color: #722d19; color: #f7f5e7; font-style: italic; font-weight: 300; padding: 0; padding-left: 35px; } .post-format-status.mceContentBody { font-size: 24px; } .post-format-status:before { background: url(../images/dotted-line.png) repeat-y left bottom; background-size: 4px 4px; content: ""; display: block; float: left; height: 100%; position: relative; left: -30px; width: 1px; } .post-format-status > p:first-child:before { background-color: rgba(0, 0, 0, 0.65); content: ""; height: 3px; width: 13px; margin-top: 13px; position: absolute; left: 9px; } .post-format-status a { color: #eadaa6; } /* Video */ .post-format-video { background-color: #db572f; } .post-format-video a { color: #fbfaf3; } /** * 11.0 RTL * ---------------------------------------------------------------------------- */ html .mceContentBody.rtl { direction: rtl; unicode-bidi: embed; } .rtl ol, .rtl ul { padding: 0 40px 0 0; } .rtl .wp-caption, .rtl tr th { text-align: right; } .rtl td { padding: 6px 0 6px 10px; text-align: right; } .rtl blockquote blockquote { margin-left: 0; margin-right: 24px; } .rtl.post-format-audio:before, .rtl.post-format-status:before, .rtl.post-format-status > p:first-child:before { background: none; content: none; }
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/css/editor-style.css
CSS
gpl3
12,140
/* Styles for older IE versions (previous to IE9). */ .site { min-width: 1040px; } .genericon:before:hover, .menu-toggle:after:hover, .date a:before:hover, .entry-meta .author a:before:hover, .format-audio .entry-content:before:hover, .comments-link a:before:hover, .tags-links a:first-child:before:hover, .categories-links a:first-child:before:hover, .edit-link > a:before:hover, .attachment-meta:before:hover, .attachment-meta a:before:hover, .comment-awaiting-moderation:before:hover, .comment-reply-link:before:hover, .comment-reply-title small a:before:hover, .bypostauthor > .comment-body .fn:before:hover { text-decoration: none; } .nav-menu .sub-menu ul, .nav-menu .children ul { left: 100%; } .site-header .home-link { max-width: 1040px; } .site-header .search-form [type="search"], .site-header .search-form [type="text"] { padding-top: 6px; } img.alignright { margin-right: 0; } img.alignleft { margin-left: 0; } .site-main .sidebar-inner { width: 1040px; } .site-main .widget-area { margin-right: 60px; } .format-image .entry-content .size-full { margin: 0; max-width: 604px; } .gallery-columns-1 .gallery-item, .gallery-columns-2 .gallery-item, .gallery-columns-3 .gallery-item { max-width: none; } .gallery img { width: auto; } .gallery-caption { background: #000; filter: alpha(opacity=0); } .gallery-item:hover .gallery-caption { filter: alpha(opacity=70); } .comment { clear: both; } .comment-meta, .comment-content, .comment-list .reply { width: 480px; } .depth-2 .comment-meta, .depth-2 .comment-content, .comment-list .depth-2 .reply { width: 460px; } .depth-3 .comment-meta, .depth-3 .comment-content, .comment-list .depth-3 .reply { width: 440px; } .depth-4 .comment-meta, .depth-4 .comment-content, .comment-list .depth-4 .reply { width: 420px; } .depth-5 .comment-meta, .depth-5 .comment-content, .comment-list .depth-5 .reply { width: 400px; } .comment-meta { margin-bottom: 0; } .widget { background: #f7f5e7; } .site-footer .widget { background: none; } /* Internet Explorer 8 */ .ie8 .site { border: 0; } .ie8 img.size-full, .ie8 img.size-large { height: auto; width: auto; } .ie8 .sidebar .entry-header, .ie8 .sidebar .entry-content, .ie8 .sidebar .entry-summary, .ie8 .sidebar .entry-meta { max-width: 724px; } .ie8 .author-info { margin-left: 0; } .ie8 .paging-navigation .nav-previous .meta-nav { padding: 5px 0 8px; width: 40px; } .ie8 .paging-navigation .nav-next { line-height: 1; } .ie8 .format-status .entry-content:before, .ie8 .format-status .entry-meta:before { content: none; } .ie8 .site-main .widget-area { margin-right: 0; } /* Internet Explorer 7 */ .ie7 audio, .ie7 canvas, .ie7 video { display: inline; zoom: 1; } .ie7 legend { margin-left: -7px; } .ie7 button, .ie7 input, .ie7 select, .ie7 textarea { vertical-align: middle; } .ie7 button, .ie7 input[type="button"], .ie7 input[type="reset"], .ie7 input[type="submit"] { overflow: visible; } .ie7 input[type="checkbox"], .ie7 input[type="radio"] { height: 13px; width: 13px; } .ie7 .screen-reader-text { clip: rect(1px 1px 1px 1px); /* IE7 */ } .ie7 .site-header { position: relative; z-index: 1; } .ie7 .main-navigation { max-width: 930px; padding-right: 150px; } .ie7 .nav-menu li a, .ie7 .nav-menu li { display: block; float: left; } .ie7 .nav-menu ul { top: 40px; } .ie7 .nav-menu .sub-menu, .ie7 .nav-menu .children { display: none; overflow: visible; } .ie7 ul.nav-menu li:hover > ul, .ie7 .nav-menu ul li:hover > ul { display: block; } .ie7 .site-header .search-form [type="search"], .ie7 .site-header .search-form [type="text"] { background-color: #fff; border: 2px solid #c3c0ab; cursor: text; height: 28px; outline: 0; width: 150px; } .ie7 .entry-header, .ie7 .entry-content, .ie7 .entry-summary, .ie7 .entry-meta { width: 604px; } .ie7 .format-status .entry-content, .ie7 .format-status .entry-meta { padding-left: 60px; } .ie7 .sidebar .format-status .entry-content, .ie7 .sidebar .format-status .entry-meta { padding-left: 60px; } .ie7 .sidebar .post-navigation .nav-links, .ie7 .sidebar .paging-navigation .nav-links { width: 604px; } .ie7 .paging-navigation .meta-nav { padding: 0 0 10px; vertical-align: middle; width: 40px; } .ie7 .comments-title, .ie7 .comment-list, .ie7 .comment-reply-title, .ie7 .comment-respond .comment-form { width: 604px; } .ie7 .site-footer .widget-area { max-width: none; left: auto; } /* RTL for Internet Explorer 7 & 8 */ .rtl .format-audio .entry-content:before, .rtl .comment-reply-link:before, .rtl .comment-reply-login:before { -ms-filter: "FlipH"; filter: FlipH; }
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/css/ie.css
CSS
gpl3
4,637
<?php /** * The template for displaying posts in the Audio post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php if ( is_single() ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else : ?> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> </h1> <?php endif; // is_single() ?> </header><!-- .entry-header --> <div class="entry-content"> <div class="audio-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .audio-content --> </div><!-- .entry-content --> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?> <?php get_template_part( 'author-bio' ); ?> <?php endif; ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-audio.php
PHP
gpl3
1,390
<?php /** * The template for displaying Comments * * The area of the page that contains comments and the comment form. * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ /* * If the current post is protected by a password and the visitor has not yet * entered the password we will return early without loading the comments. */ if ( post_password_required() ) return; ?> <div id="comments" class="comments-area"> <?php if ( have_comments() ) : ?> <h2 class="comments-title"> <?php printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentythirteen' ), number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); ?> </h2> <ol class="comment-list"> <?php wp_list_comments( array( 'style' => 'ol', 'short_ping' => true, 'avatar_size' => 74, ) ); ?> </ol><!-- .comment-list --> <?php // Are there comments to navigate through? if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> <nav class="navigation comment-navigation" role="navigation"> <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentythirteen' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentythirteen' ) ); ?></div> </nav><!-- .comment-navigation --> <?php endif; // Check for comment navigation ?> <?php if ( ! comments_open() && get_comments_number() ) : ?> <p class="no-comments"><?php _e( 'Comments are closed.' , 'twentythirteen' ); ?></p> <?php endif; ?> <?php endif; // have_comments() ?> <?php comment_form(); ?> </div><!-- #comments -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/comments.php
PHP
gpl3
1,873
<?php /** * The template for displaying Search Results pages * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentythirteen' ), get_search_query() ); ?></h1> </header> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/search.php
PHP
gpl3
860
<?php /** * The template for displaying posts in the Quote post format * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php twentythirteen_entry_meta(); ?> <?php if ( comments_open() && ! is_single() ) : ?> <span class="comments-link"> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?> </span><!-- .comments-link --> <?php endif; // comments_open() ?> <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post -->
01-wordpress-paypal
trunk/wp-content/themes/twentythirteen/content-quote.php
PHP
gpl3
1,220
<?php /** * The Footer Sidebar * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ if ( ! is_active_sidebar( 'sidebar-3' ) ) { return; } ?> <div id="supplementary"> <div id="footer-sidebar" class="footer-sidebar widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-3' ); ?> </div><!-- #footer-sidebar --> </div><!-- #supplementary -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/sidebar-footer.php
PHP
gpl3
395
<?php /** * The main template file * * This is the most generic template file in a WordPress theme and one * of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query, * e.g., it puts together the home page when no home.php file exists. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="main-content" class="main-content"> <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next post navigation. twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar( 'content' ); ?> </div><!-- #main-content --> <?php get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/index.php
PHP
gpl3
1,579
<?php /** * The Header for our theme * * Displays all of the <head> section and everything up till <div id="main"> * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?><!DOCTYPE html> <!--[if IE 7]> <html class="ie ie7" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 8]> <html class="ie ie8" <?php language_attributes(); ?>> <![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--> <html <?php language_attributes(); ?>> <!--<![endif]--> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <title><?php wp_title( '|', true, 'right' ); ?></title> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="page" class="hfeed site"> <?php if ( get_header_image() ) : ?> <div id="site-header"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt=""> </a> </div> <?php endif; ?> <header id="masthead" class="site-header" role="banner"> <div class="header-main"> <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <div class="search-toggle"> <a href="#search-container" class="screen-reader-text"><?php _e( 'Search', 'twentyfourteen' ); ?></a> </div> <nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation"> <button class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></button> <a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> </nav> </div> <div id="search-container" class="search-box-wrapper hide"> <div class="search-box"> <?php get_search_form(); ?> </div> </div> </header><!-- #masthead --> <div id="main" class="site-main">
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/header.php
PHP
gpl3
2,269
<?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); // Previous/next post navigation. twentyfourteen_post_nav(); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } endwhile; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/single.php
PHP
gpl3
1,033
<?php /** * Twenty Fourteen functions and definitions * * Set up the theme and provides some helper functions, which are used in the * theme as custom template tags. Others are attached to action and filter * hooks in WordPress to change core functionality. * * When using a child theme you can override certain functions (those wrapped * in a function_exists() call) by defining them first in your child theme's * functions.php file. The child theme's functions.php file is included before * the parent theme's file, so the child theme functions would be used. * * @link http://codex.wordpress.org/Theme_Development * @link http://codex.wordpress.org/Child_Themes * * Functions that are not pluggable (not wrapped in function_exists()) are * instead attached to a filter or action hook. * * For more information on hooks, actions, and filters, * @link http://codex.wordpress.org/Plugin_API * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ /** * Set up the content width value based on the theme's design. * * @see twentyfourteen_content_width() * * @since Twenty Fourteen 1.0 */ if ( ! isset( $content_width ) ) { $content_width = 474; } /** * Twenty Fourteen only works in WordPress 3.6 or later. */ if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; } if ( ! function_exists( 'twentyfourteen_setup' ) ) : /** * Twenty Fourteen setup. * * Set up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support post thumbnails. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_setup() { /* * Make Twenty Fourteen available for translation. * * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Fourteen, use a find and * replace to change 'twentyfourteen' to the name of your theme in all * template files. */ load_theme_textdomain( 'twentyfourteen', get_template_directory() . '/languages' ); // This theme styles the visual editor to resemble the theme style. add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url() ) ); // Add RSS feed links to <head> for posts and comments. add_theme_support( 'automatic-feed-links' ); // Enable support for Post Thumbnails, and declare two sizes. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 672, 372, true ); add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => __( 'Top primary menu', 'twentyfourteen' ), 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); /* * Enable support for Post Formats. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery', ) ); // This theme allows users to set a custom background. add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array( 'default-color' => 'f5f5f5', ) ) ); // Add support for featured content. add_theme_support( 'featured-content', array( 'featured_content_filter' => 'twentyfourteen_get_featured_posts', 'max_posts' => 6, ) ); // This theme uses its own gallery styles. add_filter( 'use_default_gallery_style', '__return_false' ); } endif; // twentyfourteen_setup add_action( 'after_setup_theme', 'twentyfourteen_setup' ); /** * Adjust content_width value for image attachment template. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_content_width() { if ( is_attachment() && wp_attachment_is_image() ) { $GLOBALS['content_width'] = 810; } } add_action( 'template_redirect', 'twentyfourteen_content_width' ); /** * Getter function for Featured Content Plugin. * * @since Twenty Fourteen 1.0 * * @return array An array of WP_Post objects. */ function twentyfourteen_get_featured_posts() { /** * Filter the featured posts to return in Twenty Fourteen. * * @since Twenty Fourteen 1.0 * * @param array|bool $posts Array of featured posts, otherwise false. */ return apply_filters( 'twentyfourteen_get_featured_posts', array() ); } /** * A helper conditional function that returns a boolean value. * * @since Twenty Fourteen 1.0 * * @return bool Whether there are featured posts. */ function twentyfourteen_has_featured_posts() { return ! is_paged() && (bool) twentyfourteen_get_featured_posts(); } /** * Register three Twenty Fourteen widget areas. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_widgets_init() { require get_template_directory() . '/inc/widgets.php'; register_widget( 'Twenty_Fourteen_Ephemera_Widget' ); register_sidebar( array( 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), 'id' => 'sidebar-1', 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Content Sidebar', 'twentyfourteen' ), 'id' => 'sidebar-2', 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), 'id' => 'sidebar-3', 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); } add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); /** * Register Lato Google font for Twenty Fourteen. * * @since Twenty Fourteen 1.0 * * @return string */ function twentyfourteen_font_url() { $font_url = ''; /* * Translators: If there are characters in your language that are not supported * by Lato, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) { $font_url = add_query_arg( 'family', urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), "//fonts.googleapis.com/css" ); } return $font_url; } /** * Enqueue scripts and styles for the front end. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_scripts() { // Add Lato font, used in the main stylesheet. wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null ); // Add Genericons font, used in the main stylesheet. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.2' ); // Load our main stylesheet. wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri(), array( 'genericons' ) ); // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style', 'genericons' ), '20131205' ); wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' ); } if ( is_active_sidebar( 'sidebar-3' ) ) { wp_enqueue_script( 'jquery-masonry' ); } if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131205', true ); wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array( 'prevText' => __( 'Previous', 'twentyfourteen' ), 'nextText' => __( 'Next', 'twentyfourteen' ) ) ); } wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140319', true ); } add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); /** * Enqueue Google fonts style to admin screen for custom header display. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_admin_fonts() { wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null ); } add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' ); if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : /** * Print the attached image with a link to the next attached image. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_the_attached_image() { $post = get_post(); /** * Filter the default Twenty Fourteen attachment size. * * @since Twenty Fourteen 1.0 * * @param array $dimensions { * An array of height and width dimensions. * * @type int $height Height of the image in pixels. Default 810. * @type int $width Width of the image in pixels. Default 810. * } */ $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) ); $next_attachment_url = wp_get_attachment_url(); /* * Grab the IDs of all the image attachments in a gallery so we can get the URL * of the next adjacent image in a gallery, or the first image (if we're * looking at the last image in a gallery), or, in a gallery of one, just the * link to that image file. */ $attachment_ids = get_posts( array( 'post_parent' => $post->post_parent, 'fields' => 'ids', 'numberposts' => -1, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', ) ); // If there is more than 1 attachment in a gallery... if ( count( $attachment_ids ) > 1 ) { foreach ( $attachment_ids as $attachment_id ) { if ( $attachment_id == $post->ID ) { $next_id = current( $attachment_ids ); break; } } // get the URL of the next image attachment... if ( $next_id ) { $next_attachment_url = get_attachment_link( $next_id ); } // or get the URL of the first image attachment. else { $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) ); } } printf( '<a href="%1$s" rel="attachment">%2$s</a>', esc_url( $next_attachment_url ), wp_get_attachment_image( $post->ID, $attachment_size ) ); } endif; if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : /** * Print a list of all site contributors who published at least one post. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_list_authors() { $contributor_ids = get_users( array( 'fields' => 'ID', 'orderby' => 'post_count', 'order' => 'DESC', 'who' => 'authors', ) ); foreach ( $contributor_ids as $contributor_id ) : $post_count = count_user_posts( $contributor_id ); // Move on if user has not published a post (yet). if ( ! $post_count ) { continue; } ?> <div class="contributor"> <div class="contributor-info"> <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div> <div class="contributor-summary"> <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2> <p class="contributor-bio"> <?php echo get_the_author_meta( 'description', $contributor_id ); ?> </p> <a class="button contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>"> <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?> </a> </div><!-- .contributor-summary --> </div><!-- .contributor-info --> </div><!-- .contributor --> <?php endforeach; } endif; /** * Extend the default WordPress body classes. * * Adds body classes to denote: * 1. Single or multiple authors. * 2. Presence of header image. * 3. Index views. * 4. Full-width content layout. * 5. Presence of footer widgets. * 6. Single views. * 7. Featured content layout. * * @since Twenty Fourteen 1.0 * * @param array $classes A list of existing body class values. * @return array The filtered body class list. */ function twentyfourteen_body_classes( $classes ) { if ( is_multi_author() ) { $classes[] = 'group-blog'; } if ( get_header_image() ) { $classes[] = 'header-image'; } else { $classes[] = 'masthead-fixed'; } if ( is_archive() || is_search() || is_home() ) { $classes[] = 'list-view'; } if ( ( ! is_active_sidebar( 'sidebar-2' ) ) || is_page_template( 'page-templates/full-width.php' ) || is_page_template( 'page-templates/contributors.php' ) || is_attachment() ) { $classes[] = 'full-width'; } if ( is_active_sidebar( 'sidebar-3' ) ) { $classes[] = 'footer-widgets'; } if ( is_singular() && ! is_front_page() ) { $classes[] = 'singular'; } if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { $classes[] = 'slider'; } elseif ( is_front_page() ) { $classes[] = 'grid'; } return $classes; } add_filter( 'body_class', 'twentyfourteen_body_classes' ); /** * Extend the default WordPress post classes. * * Adds a post class to denote: * Non-password protected page with a post thumbnail. * * @since Twenty Fourteen 1.0 * * @param array $classes A list of existing post class values. * @return array The filtered post class list. */ function twentyfourteen_post_classes( $classes ) { if ( ! post_password_required() && ! is_attachment() && has_post_thumbnail() ) { $classes[] = 'has-post-thumbnail'; } return $classes; } add_filter( 'post_class', 'twentyfourteen_post_classes' ); /** * Create a nicely formatted and more specific title element text for output * in head of document, based on current view. * * @since Twenty Fourteen 1.0 * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string The filtered title. */ function twentyfourteen_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) { return $title; } // Add the site name. $title .= get_bloginfo( 'name', 'display' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) { $title = "$title $sep $site_description"; } // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) { $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyfourteen' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 ); // Implement Custom Header features. require get_template_directory() . '/inc/custom-header.php'; // Custom template tags for this theme. require get_template_directory() . '/inc/template-tags.php'; // Add Theme Customizer functionality. require get_template_directory() . '/inc/customizer.php'; /* * Add Featured Content functionality. * * To overwrite in a plugin, define your own Featured_Content class on or * before the 'setup_theme' hook. */ if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) { require get_template_directory() . '/inc/featured-content.php'; }
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/functions.php
PHP
gpl3
16,043
<?php /** * The template for displaying posts in the Aside post format * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php twentyfourteen_post_thumbnail(); ?> <header class="entry-header"> <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> <?php endif; if ( is_single() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; ?> <div class="entry-meta"> <span class="post-format"> <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'aside' ) ); ?>"><?php echo get_post_format_string( 'aside' ); ?></a> </span> <?php twentyfourteen_posted_on(); ?> <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> </article><!-- #post-## -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/content-aside.php
PHP
gpl3
2,167
<?php /** * The template for displaying posts in the Gallery post format * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php twentyfourteen_post_thumbnail(); ?> <header class="entry-header"> <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> <?php endif; if ( is_single() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; ?> <div class="entry-meta"> <span class="post-format"> <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>"><?php echo get_post_format_string( 'gallery' ); ?></a> </span> <?php twentyfourteen_posted_on(); ?> <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> </article><!-- #post-## -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/content-gallery.php
PHP
gpl3
2,173
<?php /** * The template for displaying image attachments * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ // Retrieve attachment metadata. $metadata = wp_get_attachment_metadata(); get_header(); ?> <section id="primary" class="content-area image-attachment"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> <div class="entry-meta"> <span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span> <span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span> <span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span> <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <div class="entry-attachment"> <div class="attachment"> <?php twentyfourteen_the_attached_image(); ?> </div><!-- .attachment --> <?php if ( has_excerpt() ) : ?> <div class="entry-caption"> <?php the_excerpt(); ?> </div><!-- .entry-caption --> <?php endif; ?> </div><!-- .entry-attachment --> <?php the_content(); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> </article><!-- #post-## --> <nav id="image-navigation" class="navigation image-navigation"> <div class="nav-links"> <?php previous_image_link( false, '<div class="previous-image">' . __( 'Previous Image', 'twentyfourteen' ) . '</div>' ); ?> <?php next_image_link( false, '<div class="next-image">' . __( 'Next Image', 'twentyfourteen' ) . '</div>' ); ?> </div><!-- .nav-links --> </nav><!-- #image-navigation --> <?php comments_template(); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/image.php
PHP
gpl3
2,657
<?php /** * Implement Custom Header functionality for Twenty Fourteen * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ /** * Set up the WordPress core custom header settings. * * @since Twenty Fourteen 1.0 * * @uses twentyfourteen_header_style() * @uses twentyfourteen_admin_header_style() * @uses twentyfourteen_admin_header_image() */ function twentyfourteen_custom_header_setup() { /** * Filter Twenty Fourteen custom-header support arguments. * * @since Twenty Fourteen 1.0 * * @param array $args { * An array of custom-header support arguments. * * @type bool $header_text Whether to display custom header text. Default false. * @type int $width Width in pixels of the custom header image. Default 1260. * @type int $height Height in pixels of the custom header image. Default 240. * @type bool $flex_height Whether to allow flexible-height header images. Default true. * @type string $admin_head_callback Callback function used to style the image displayed in * the Appearance > Header screen. * @type string $admin_preview_callback Callback function used to create the custom header markup in * the Appearance > Header screen. * } */ add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( 'default-text-color' => 'fff', 'width' => 1260, 'height' => 240, 'flex-height' => true, 'wp-head-callback' => 'twentyfourteen_header_style', 'admin-head-callback' => 'twentyfourteen_admin_header_style', 'admin-preview-callback' => 'twentyfourteen_admin_header_image', ) ) ); } add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); if ( ! function_exists( 'twentyfourteen_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @see twentyfourteen_custom_header_setup(). * */ function twentyfourteen_header_style() { $text_color = get_header_textcolor(); // If no custom color for text is set, let's bail. if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) return; // If we get this far, we have custom styles. ?> <style type="text/css" id="twentyfourteen-header-css"> <?php // Has the text been hidden? if ( ! display_header_text() ) : ?> .site-title, .site-description { clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); position: absolute; } <?php // If the user has set a custom color for the text, use that. elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) : ?> .site-title a { color: #<?php echo esc_attr( $text_color ); ?>; } <?php endif; ?> </style> <?php } endif; // twentyfourteen_header_style if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : /** * Style the header image displayed on the Appearance > Header screen. * * @see twentyfourteen_custom_header_setup() * * @since Twenty Fourteen 1.0 */ function twentyfourteen_admin_header_style() { ?> <style type="text/css" id="twentyfourteen-admin-header-css"> .appearance_page_custom-header #headimg { background-color: #000; border: none; max-width: 1260px; min-height: 48px; } #headimg h1 { font-family: Lato, sans-serif; font-size: 18px; line-height: 48px; margin: 0 0 0 30px; } #headimg h1 a { color: #fff; text-decoration: none; } #headimg img { vertical-align: middle; } </style> <?php } endif; // twentyfourteen_admin_header_style if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : /** * Create the custom header image markup displayed on the Appearance > Header screen. * * @see twentyfourteen_custom_header_setup() * * @since Twenty Fourteen 1.0 */ function twentyfourteen_admin_header_image() { ?> <div id="headimg"> <?php if ( get_header_image() ) : ?> <img src="<?php header_image(); ?>" alt=""> <?php endif; ?> <h1 class="displaying-header-text"><a id="name"<?php echo sprintf( ' style="color:#%s;"', get_header_textcolor() ); ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1> </div> <?php } endif; // twentyfourteen_admin_header_image
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/inc/custom-header.php
PHP
gpl3
4,446
<?php /** * Custom template tags for Twenty Fourteen * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ if ( ! function_exists( 'twentyfourteen_paging_nav' ) ) : /** * Display navigation to next/previous set of posts when applicable. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_paging_nav() { // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map( 'urlencode', $query_args ), 'prev_text' => __( '&larr; Previous', 'twentyfourteen' ), 'next_text' => __( 'Next &rarr;', 'twentyfourteen' ), ) ); if ( $links ) : ?> <nav class="navigation paging-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentyfourteen' ); ?></h1> <div class="pagination loop-pagination"> <?php echo $links; ?> </div><!-- .pagination --> </nav><!-- .navigation --> <?php endif; } endif; if ( ! function_exists( 'twentyfourteen_post_nav' ) ) : /** * Display navigation to next/previous post when applicable. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_post_nav() { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1> <div class="nav-links"> <?php if ( is_attachment() ) : previous_post_link( '%link', __( '<span class="meta-nav">Published In</span>%title', 'twentyfourteen' ) ); else : previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) ); next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) ); endif; ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php } endif; if ( ! function_exists( 'twentyfourteen_posted_on' ) ) : /** * Print HTML with meta information for the current post-date/time and author. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_posted_on() { if ( is_sticky() && is_home() && ! is_paged() ) { echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>'; } // Set up and print post meta information. printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', esc_url( get_permalink() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_the_author() ); } endif; /** * Find out if blog has more than one category. * * @since Twenty Fourteen 1.0 * * @return boolean true if blog has more than 1 category */ function twentyfourteen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ) ) ) { // Create an array of all the categories that are attached to posts $all_the_cool_cats = get_categories( array( 'hide_empty' => 1, ) ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'twentyfourteen_category_count', $all_the_cool_cats ); } if ( 1 !== (int) $all_the_cool_cats ) { // This blog has more than 1 category so twentyfourteen_categorized_blog should return true return true; } else { // This blog has only 1 category so twentyfourteen_categorized_blog should return false return false; } } /** * Flush out the transients used in twentyfourteen_categorized_blog. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'twentyfourteen_category_count' ); } add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); /** * Display an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index * views, or a div element when on single views. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?> <div class="post-thumbnail"> <?php if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { the_post_thumbnail( 'twentyfourteen-full-width' ); } else { the_post_thumbnail(); } ?> </div> <?php else : ?> <a class="post-thumbnail" href="<?php the_permalink(); ?>"> <?php if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { the_post_thumbnail( 'twentyfourteen-full-width' ); } else { the_post_thumbnail(); } ?> </a> <?php endif; // End is_singular() }
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/inc/template-tags.php
PHP
gpl3
6,058
<?php /** * Twenty Fourteen Theme Customizer support * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ /** * Implement Theme Customizer additions and adjustments. * * @since Twenty Fourteen 1.0 * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function twentyfourteen_customize_register( $wp_customize ) { // Add custom description to Colors and Background sections. $wp_customize->get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); // Add postMessage support for site title and description. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; // Rename the label to "Site Title Color" because this only affects the site title in this theme. $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' ); // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear. $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title &amp; Tagline', 'twentyfourteen' ); // Add the featured content section in case it's not already there. $wp_customize->add_section( 'featured_content', array( 'title' => __( 'Featured Content', 'twentyfourteen' ), 'description' => sprintf( __( 'Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'edit.php?show_sticky=1' ) ), 'priority' => 130, ) ); // Add the featured content layout setting and control. $wp_customize->add_setting( 'featured_content_layout', array( 'default' => 'grid', 'sanitize_callback' => 'twentyfourteen_sanitize_layout', ) ); $wp_customize->add_control( 'featured_content_layout', array( 'label' => __( 'Layout', 'twentyfourteen' ), 'section' => 'featured_content', 'type' => 'select', 'choices' => array( 'grid' => __( 'Grid', 'twentyfourteen' ), 'slider' => __( 'Slider', 'twentyfourteen' ), ), ) ); } add_action( 'customize_register', 'twentyfourteen_customize_register' ); /** * Sanitize the Featured Content layout value. * * @since Twenty Fourteen 1.0 * * @param string $layout Layout type. * @return string Filtered layout type (grid|slider). */ function twentyfourteen_sanitize_layout( $layout ) { if ( ! in_array( $layout, array( 'grid', 'slider' ) ) ) { $layout = 'grid'; } return $layout; } /** * Bind JS handlers to make Theme Customizer preview reload changes asynchronously. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_customize_preview_js() { wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20131205', true ); } add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' ); /** * Add contextual help to the Themes and Post edit screens. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_contextual_help() { if ( 'admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow'] ) { return; } get_current_screen()->add_help_tab( array( 'id' => 'twentyfourteen', 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), 'content' => '<ul>' . '<li>' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '</li>' . '<li>' . sprintf( __( 'Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen' ), 'http://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '</li>' . '<li>' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen' ), 'http://codex.wordpress.org/Twenty_Fourteen' ) . '</li>' . '</ul>', ) ); } add_action( 'admin_head-themes.php', 'twentyfourteen_contextual_help' ); add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' );
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/inc/customizer.php
PHP
gpl3
5,223
<?php /** * Twenty Fourteen back compat functionality * * Prevents Twenty Fourteen from running on WordPress versions prior to 3.6, * since this theme is not meant to be backward compatible beyond that * and relies on many newer functions and markup changes introduced in 3.6. * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ /** * Prevent switching to Twenty Fourteen on old versions of WordPress. * * Switches to the default theme. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_switch_theme() { switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME ); unset( $_GET['activated'] ); add_action( 'admin_notices', 'twentyfourteen_upgrade_notice' ); } add_action( 'after_switch_theme', 'twentyfourteen_switch_theme' ); /** * Add message for unsuccessful theme switch. * * Prints an update nag after an unsuccessful attempt to switch to * Twenty Fourteen on WordPress versions prior to 3.6. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_upgrade_notice() { $message = sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ); printf( '<div class="error"><p>%s</p></div>', $message ); } /** * Prevent the Theme Customizer from being loaded on WordPress versions prior to 3.6. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_customize() { wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), '', array( 'back_link' => true, ) ); } add_action( 'load-customize.php', 'twentyfourteen_customize' ); /** * Prevent the Theme Preview from being loaded on WordPress versions prior to 3.4. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_preview() { if ( isset( $_GET['preview'] ) ) { wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ) ); } } add_action( 'template_redirect', 'twentyfourteen_preview' );
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/inc/back-compat.php
PHP
gpl3
2,195
<?php /** * Custom Widget for displaying specific post formats * * Displays posts from Aside, Quote, Video, Audio, Image, Gallery, and Link formats. * * @link http://codex.wordpress.org/Widgets_API#Developing_Widgets * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * The supported post formats. * * @access private * @since Twenty Fourteen 1.0 * * @var array */ private $formats = array( 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery' ); /** * Constructor. * * @since Twenty Fourteen 1.0 * * @return Twenty_Fourteen_Ephemera_Widget */ public function __construct() { parent::__construct( 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array( 'classname' => 'widget_twentyfourteen_ephemera', 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), ) ); } /** * Output the HTML for this widget. * * @access public * @since Twenty Fourteen 1.0 * * @param array $args An array of standard parameters for widgets in this theme. * @param array $instance An array of settings for this widget instance. */ public function widget( $args, $instance ) { $format = $instance['format']; switch ( $format ) { case 'image': $format_string = __( 'Images', 'twentyfourteen' ); $format_string_more = __( 'More images', 'twentyfourteen' ); break; case 'video': $format_string = __( 'Videos', 'twentyfourteen' ); $format_string_more = __( 'More videos', 'twentyfourteen' ); break; case 'audio': $format_string = __( 'Audio', 'twentyfourteen' ); $format_string_more = __( 'More audio', 'twentyfourteen' ); break; case 'quote': $format_string = __( 'Quotes', 'twentyfourteen' ); $format_string_more = __( 'More quotes', 'twentyfourteen' ); break; case 'link': $format_string = __( 'Links', 'twentyfourteen' ); $format_string_more = __( 'More links', 'twentyfourteen' ); break; case 'gallery': $format_string = __( 'Galleries', 'twentyfourteen' ); $format_string_more = __( 'More galleries', 'twentyfourteen' ); break; case 'aside': default: $format_string = __( 'Asides', 'twentyfourteen' ); $format_string_more = __( 'More asides', 'twentyfourteen' ); break; } $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $format_string : $instance['title'], $instance, $this->id_base ); $ephemera = new WP_Query( array( 'order' => 'DESC', 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'post__not_in' => get_option( 'sticky_posts' ), 'tax_query' => array( array( 'taxonomy' => 'post_format', 'terms' => array( "post-format-$format" ), 'field' => 'slug', 'operator' => 'IN', ), ), ) ); if ( $ephemera->have_posts() ) : $tmp_content_width = $GLOBALS['content_width']; $GLOBALS['content_width'] = 306; echo $args['before_widget']; ?> <h1 class="widget-title <?php echo esc_attr( $format ); ?>"> <a class="entry-format" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php echo $title; ?></a> </h1> <ol> <?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); $tmp_more = $GLOBALS['more']; $GLOBALS['more'] = 0; ?> <li> <article <?php post_class(); ?>> <div class="entry-content"> <?php if ( has_post_format( 'gallery' ) ) : if ( post_password_required() ) : the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); else : $images = array(); $galleries = get_post_galleries( get_the_ID(), false ); if ( isset( $galleries[0]['ids'] ) ) $images = explode( ',', $galleries[0]['ids'] ); if ( ! $images ) : $images = get_posts( array( 'fields' => 'ids', 'numberposts' => -1, 'order' => 'ASC', 'orderby' => 'menu_order', 'post_mime_type' => 'image', 'post_parent' => get_the_ID(), 'post_type' => 'attachment', ) ); endif; $total_images = count( $images ); if ( has_post_thumbnail() ) : $post_thumbnail = get_the_post_thumbnail(); elseif ( $total_images > 0 ) : $image = array_shift( $images ); $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' ); endif; if ( ! empty ( $post_thumbnail ) ) : ?> <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a> <?php endif; ?> <p class="wp-caption-text"> <?php printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ), esc_url( get_permalink() ), number_format_i18n( $total_images ) ); ?> </p> <?php endif; else : the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); endif; ?> </div><!-- .entry-content --> <header class="entry-header"> <div class="entry-meta"> <?php if ( ! has_post_format( 'link' ) ) : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', esc_url( get_permalink() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_the_author() ); if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> <?php endif; ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> </article><!-- #post-## --> </li> <?php endwhile; ?> </ol> <a class="post-format-archive-link" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"> <?php /* translators: used with More archives link */ printf( __( '%s <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ), $format_string_more ); ?> </a> <?php echo $args['after_widget']; // Reset the post globals as this query will have stomped on it. wp_reset_postdata(); $GLOBALS['more'] = $tmp_more; $GLOBALS['content_width'] = $tmp_content_width; endif; // End check for ephemeral posts. } /** * Deal with the settings when they are saved by the admin. * * Here is where any validation should happen. * * @since Twenty Fourteen 1.0 * * @param array $new_instance New widget instance. * @param array $instance Original widget instance. * @return array Updated widget instance. */ function update( $new_instance, $instance ) { $instance['title'] = strip_tags( $new_instance['title'] ); $instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] ); if ( in_array( $new_instance['format'], $this->formats ) ) { $instance['format'] = $new_instance['format']; } return $instance; } /** * Display the form for this widget on the Widgets page of the Admin area. * * @since Twenty Fourteen 1.0 * * @param array $instance */ function form( $instance ) { $title = empty( $instance['title'] ) ? '' : esc_attr( $instance['title'] ); $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); $format = isset( $instance['format'] ) && in_array( $instance['format'], $this->formats ) ? $instance['format'] : 'aside'; ?> <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyfourteen' ); ?></label> <input id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>"></p> <p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php _e( 'Number of posts to show:', 'twentyfourteen' ); ?></label> <input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p> <p><label for="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>"><?php _e( 'Post format to show:', 'twentyfourteen' ); ?></label> <select id="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'format' ) ); ?>"> <?php foreach ( $this->formats as $slug ) : ?> <option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $format, $slug ); ?>><?php echo get_post_format_string( $slug ); ?></option> <?php endforeach; ?> </select> <?php } }
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/inc/widgets.php
PHP
gpl3
9,732
<?php /** * Twenty Fourteen Featured Content * * This module allows you to define a subset of posts to be displayed * in the theme's Featured Content area. * * For maximum compatibility with different methods of posting users * will designate a featured post tag to associate posts with. Since * this tag now has special meaning beyond that of a normal tags, users * will have the ability to hide it from the front-end of their site. */ class Featured_Content { /** * The maximum number of posts a Featured Content area can contain. * * We define a default value here but themes can override * this by defining a "max_posts" entry in the second parameter * passed in the call to add_theme_support( 'featured-content' ). * * @see Featured_Content::init() * * @since Twenty Fourteen 1.0 * * @static * @access public * @var int */ public static $max_posts = 15; /** * Instantiate. * * All custom functionality will be hooked into the "init" action. * * @static * @access public * @since Twenty Fourteen 1.0 */ public static function setup() { add_action( 'init', array( __CLASS__, 'init' ), 30 ); } /** * Conditionally hook into WordPress. * * Theme must declare that they support this module by adding * add_theme_support( 'featured-content' ); during after_setup_theme. * * If no theme support is found there is no need to hook into WordPress. * We'll just return early instead. * * @static * @access public * @since Twenty Fourteen 1.0 */ public static function init() { $theme_support = get_theme_support( 'featured-content' ); // Return early if theme does not support Featured Content. if ( ! $theme_support ) { return; } /* * An array of named arguments must be passed as the second parameter * of add_theme_support(). */ if ( ! isset( $theme_support[0] ) ) { return; } // Return early if "featured_content_filter" has not been defined. if ( ! isset( $theme_support[0]['featured_content_filter'] ) ) { return; } $filter = $theme_support[0]['featured_content_filter']; // Theme can override the number of max posts. if ( isset( $theme_support[0]['max_posts'] ) ) { self::$max_posts = absint( $theme_support[0]['max_posts'] ); } add_filter( $filter, array( __CLASS__, 'get_featured_posts' ) ); add_action( 'customize_register', array( __CLASS__, 'customize_register' ), 9 ); add_action( 'admin_init', array( __CLASS__, 'register_setting' ) ); add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ) ); add_action( 'save_post', array( __CLASS__, 'delete_transient' ) ); add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ) ); add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ) ); } /** * Hide "featured" tag from the front-end. * * Has to run on wp_loaded so that the preview filters of the customizer * have a chance to alter the value. * * @static * @access public * @since Twenty Fourteen 1.0 */ public static function wp_loaded() { if ( self::get_setting( 'hide-tag' ) ) { add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 2 ); add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 ); } } /** * Get featured posts. * * @static * @access public * @since Twenty Fourteen 1.0 * * @return array Array of featured posts. */ public static function get_featured_posts() { $post_ids = self::get_featured_post_ids(); // No need to query if there is are no featured posts. if ( empty( $post_ids ) ) { return array(); } $featured_posts = get_posts( array( 'include' => $post_ids, 'posts_per_page' => count( $post_ids ), ) ); return $featured_posts; } /** * Get featured post IDs * * This function will return the an array containing the * post IDs of all featured posts. * * Sets the "featured_content_ids" transient. * * @static * @access public * @since Twenty Fourteen 1.0 * * @return array Array of post IDs. */ public static function get_featured_post_ids() { // Return array of cached results if they exist. $featured_ids = get_transient( 'featured_content_ids' ); if ( ! empty( $featured_ids ) ) { return array_map( 'absint', (array) $featured_ids ); } $settings = self::get_setting(); // Return sticky post ids if no tag name is set. $term = get_term_by( 'name', $settings['tag-name'], 'post_tag' ); if ( $term ) { $tag = $term->term_id; } else { return self::get_sticky_posts(); } // Query for featured posts. $featured = get_posts( array( 'numberposts' => self::$max_posts, 'tax_query' => array( array( 'field' => 'term_id', 'taxonomy' => 'post_tag', 'terms' => $tag, ), ), ) ); // Return array with sticky posts if no Featured Content exists. if ( ! $featured ) { return self::get_sticky_posts(); } // Ensure correct format before save/return. $featured_ids = wp_list_pluck( (array) $featured, 'ID' ); $featured_ids = array_map( 'absint', $featured_ids ); set_transient( 'featured_content_ids', $featured_ids ); return $featured_ids; } /** * Return an array with IDs of posts maked as sticky. * * @static * @access public * @since Twenty Fourteen 1.0 * * @return array Array of sticky posts. */ public static function get_sticky_posts() { $settings = self::get_setting(); return array_slice( get_option( 'sticky_posts', array() ), 0, self::$max_posts ); } /** * Delete featured content ids transient. * * Hooks in the "save_post" action. * * @see Featured_Content::validate_settings(). * * @static * @access public * @since Twenty Fourteen 1.0 */ public static function delete_transient() { delete_transient( 'featured_content_ids' ); } /** * Exclude featured posts from the home page blog query. * * Filter the home page posts, and remove any featured post ID's from it. * Hooked onto the 'pre_get_posts' action, this changes the parameters of * the query before it gets any posts. * * @static * @access public * @since Twenty Fourteen 1.0 * * @param WP_Query $query WP_Query object. * @return WP_Query Possibly-modified WP_Query. */ public static function pre_get_posts( $query ) { // Bail if not home or not main query. if ( ! $query->is_home() || ! $query->is_main_query() ) { return; } $page_on_front = get_option( 'page_on_front' ); // Bail if the blog page is not the front page. if ( ! empty( $page_on_front ) ) { return; } $featured = self::get_featured_post_ids(); // Bail if no featured posts. if ( ! $featured ) { return; } // We need to respect post ids already in the blacklist. $post__not_in = $query->get( 'post__not_in' ); if ( ! empty( $post__not_in ) ) { $featured = array_merge( (array) $post__not_in, $featured ); $featured = array_unique( $featured ); } $query->set( 'post__not_in', $featured ); } /** * Reset tag option when the saved tag is deleted. * * It's important to mention that the transient needs to be deleted, * too. While it may not be obvious by looking at the function alone, * the transient is deleted by Featured_Content::validate_settings(). * * Hooks in the "delete_post_tag" action. * * @see Featured_Content::validate_settings(). * * @static * @access public * @since Twenty Fourteen 1.0 * * @param int $tag_id The term_id of the tag that has been deleted. */ public static function delete_post_tag( $tag_id ) { $settings = self::get_setting(); if ( empty( $settings['tag-id'] ) || $tag_id != $settings['tag-id'] ) { return; } $settings['tag-id'] = 0; $settings = self::validate_settings( $settings ); update_option( 'featured-content', $settings ); } /** * Hide featured tag from displaying when global terms are queried from the front-end. * * Hooks into the "get_terms" filter. * * @static * @access public * @since Twenty Fourteen 1.0 * * @param array $terms List of term objects. This is the return value of get_terms(). * @param array $taxonomies An array of taxonomy slugs. * @return array A filtered array of terms. * * @uses Featured_Content::get_setting() */ public static function hide_featured_term( $terms, $taxonomies ) { // This filter is only appropriate on the front-end. if ( is_admin() ) { return $terms; } // We only want to hide the featured tag. if ( ! in_array( 'post_tag', $taxonomies ) ) { return $terms; } // Bail if no terms were returned. if ( empty( $terms ) ) { return $terms; } $settings = self::get_setting(); foreach( $terms as $order => $term ) { if ( ( $settings['tag-id'] === $term->term_id || $settings['tag-name'] === $term->name ) && 'post_tag' === $term->taxonomy ) { unset( $terms[ $order ] ); } } return $terms; } /** * Hide featured tag from display when terms associated with a post object * are queried from the front-end. * * Hooks into the "get_the_terms" filter. * * @static * @access public * @since Twenty Fourteen 1.0 * * @param array $terms A list of term objects. This is the return value of get_the_terms(). * @param int $id The ID field for the post object that terms are associated with. * @param array $taxonomy An array of taxonomy slugs. * @return array Filtered array of terms. * * @uses Featured_Content::get_setting() */ public static function hide_the_featured_term( $terms, $id, $taxonomy ) { // This filter is only appropriate on the front-end. if ( is_admin() ) { return $terms; } // Make sure we are in the correct taxonomy. if ( 'post_tag' != $taxonomy ) { return $terms; } // No terms? Return early! if ( empty( $terms ) ) { return $terms; } $settings = self::get_setting(); foreach( $terms as $order => $term ) { if ( ( $settings['tag-id'] === $term->term_id || $settings['tag-name'] === $term->name ) && 'post_tag' === $term->taxonomy ) { unset( $terms[ $term->term_id ] ); } } return $terms; } /** * Register custom setting on the Settings -> Reading screen. * * @static * @access public * @since Twenty Fourteen 1.0 */ public static function register_setting() { register_setting( 'featured-content', 'featured-content', array( __CLASS__, 'validate_settings' ) ); } /** * Add settings to the Customizer. * * @static * @access public * @since Twenty Fourteen 1.0 * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ public static function customize_register( $wp_customize ) { $wp_customize->add_section( 'featured_content', array( 'title' => __( 'Featured Content', 'twentyfourteen' ), 'description' => sprintf( __( 'Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'edit.php?show_sticky=1' ) ), 'priority' => 130, 'theme_supports' => 'featured-content', ) ); // Add Featured Content settings. $wp_customize->add_setting( 'featured-content[tag-name]', array( 'default' => _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), 'type' => 'option', 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), ) ); $wp_customize->add_setting( 'featured-content[hide-tag]', array( 'default' => true, 'type' => 'option', 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), ) ); // Add Featured Content controls. $wp_customize->add_control( 'featured-content[tag-name]', array( 'label' => __( 'Tag Name', 'twentyfourteen' ), 'section' => 'featured_content', 'priority' => 20, ) ); $wp_customize->add_control( 'featured-content[hide-tag]', array( 'label' => __( 'Don&rsquo;t display tag on front end.', 'twentyfourteen' ), 'section' => 'featured_content', 'type' => 'checkbox', 'priority' => 30, ) ); } /** * Enqueue the tag suggestion script. * * @static * @access public * @since Twenty Fourteen 1.0 */ public static function enqueue_scripts() { wp_enqueue_script( 'featured-content-suggest', get_template_directory_uri() . '/js/featured-content-admin.js', array( 'jquery', 'suggest' ), '20131022', true ); } /** * Get featured content settings. * * Get all settings recognized by this module. This function * will return all settings whether or not they have been stored * in the database yet. This ensures that all keys are available * at all times. * * In the event that you only require one setting, you may pass * its name as the first parameter to the function and only that * value will be returned. * * @static * @access public * @since Twenty Fourteen 1.0 * * @param string $key The key of a recognized setting. * @return mixed Array of all settings by default. A single value if passed as first parameter. */ public static function get_setting( $key = 'all' ) { $saved = (array) get_option( 'featured-content' ); $defaults = array( 'hide-tag' => 1, 'tag-id' => 0, 'tag-name' => _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), ); $options = wp_parse_args( $saved, $defaults ); $options = array_intersect_key( $options, $defaults ); if ( 'all' != $key ) { return isset( $options[ $key ] ) ? $options[ $key ] : false; } return $options; } /** * Validate featured content settings. * * Make sure that all user supplied content is in an expected * format before saving to the database. This function will also * delete the transient set in Featured_Content::get_featured_content(). * * @static * @access public * @since Twenty Fourteen 1.0 * * @param array $input Array of settings input. * @return array Validated settings output. */ public static function validate_settings( $input ) { $output = array(); if ( empty( $input['tag-name'] ) ) { $output['tag-id'] = 0; } else { $term = get_term_by( 'name', $input['tag-name'], 'post_tag' ); if ( $term ) { $output['tag-id'] = $term->term_id; } else { $new_tag = wp_create_tag( $input['tag-name'] ); if ( ! is_wp_error( $new_tag ) && isset( $new_tag['term_id'] ) ) { $output['tag-id'] = $new_tag['term_id']; } } $output['tag-name'] = $input['tag-name']; } $output['hide-tag'] = isset( $input['hide-tag'] ) && $input['hide-tag'] ? 1 : 0; // Delete the featured post ids transient. self::delete_transient(); return $output; } } // Featured_Content Featured_Content::setup();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/inc/featured-content.php
PHP
gpl3
15,310
<?php /** * The template for displaying all pages * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages and that * other 'pages' on your WordPress site will use a different template. * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="main-content" class="main-content"> <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); // Include the page content template. get_template_part( 'content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } endwhile; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar( 'content' ); ?> </div><!-- #main-content --> <?php get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/page.php
PHP
gpl3
1,187
<?php /** * The template for displaying posts in the Link post format * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php twentyfourteen_post_thumbnail(); ?> <header class="entry-header"> <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> <?php endif; if ( is_single() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; ?> <div class="entry-meta"> <span class="post-format"> <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'link' ) ); ?>"><?php echo get_post_format_string( 'link' ); ?></a> </span> <?php twentyfourteen_posted_on(); ?> <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> </article><!-- #post-## -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/content-link.php
PHP
gpl3
2,164
/** * Twenty Fourteen keyboard support for image navigation. */ ( function( $ ) { $( document ).on( 'keydown.twentyfourteen', function( e ) { var url = false; // Left arrow key code. if ( e.which === 37 ) { url = $( '.previous-image a' ).attr( 'href' ); // Right arrow key code. } else if ( e.which === 39 ) { url = $( '.entry-attachment a' ).attr( 'href' ); } if ( url && ( !$( 'textarea, input' ).is( ':focus' ) ) ) { window.location = url; } } ); } )( jQuery );
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js
JavaScript
gpl3
496
/** * Twenty Fourteen Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ ( function( $ ) { // Site title and description. wp.customize( 'blogname', function( value ) { value.bind( function( to ) { $( '.site-title a' ).text( to ); } ); } ); wp.customize( 'blogdescription', function( value ) { value.bind( function( to ) { $( '.site-description' ).text( to ); } ); } ); // Header text color. wp.customize( 'header_textcolor', function( value ) { value.bind( function( to ) { if ( 'blank' === to ) { $( '.site-title, .site-description' ).css( { 'clip': 'rect(1px, 1px, 1px, 1px)', 'position': 'absolute' } ); } else { $( '.site-title, .site-description' ).css( { 'clip': 'auto', 'position': 'static' } ); $( '.site-title a' ).css( { 'color': to } ); } } ); } ); } )( jQuery );
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/js/customizer.js
JavaScript
gpl3
962
/** * Theme functions file * * Contains handlers for navigation, accessibility, header sizing * footer widgets and Featured Content slider * */ ( function( $ ) { var body = $( 'body' ), _window = $( window ); // Enable menu toggle for small screens. ( function() { var nav = $( '#primary-navigation' ), button, menu; if ( ! nav ) { return; } button = nav.find( '.menu-toggle' ); if ( ! button ) { return; } // Hide button if menu is missing or empty. menu = nav.find( '.nav-menu' ); if ( ! menu || ! menu.children().length ) { button.hide(); return; } $( '.menu-toggle' ).on( 'click.twentyfourteen', function() { nav.toggleClass( 'toggled-on' ); } ); } )(); /* * Makes "skip to content" link work correctly in IE9 and Chrome for better * accessibility. * * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ */ _window.on( 'hashchange.twentyfourteen', function() { var element = document.getElementById( location.hash.substring( 1 ) ); if ( element ) { if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) { element.tabIndex = -1; } element.focus(); // Repositions the window on jump-to-anchor to account for header height. window.scrollBy( 0, -80 ); } } ); $( function() { // Search toggle. $( '.search-toggle' ).on( 'click.twentyfourteen', function( event ) { var that = $( this ), wrapper = $( '.search-box-wrapper' ); that.toggleClass( 'active' ); wrapper.toggleClass( 'hide' ); if ( that.is( '.active' ) || $( '.search-toggle .screen-reader-text' )[0] === event.target ) { wrapper.find( '.search-field' ).focus(); } } ); /* * Fixed header for large screen. * If the header becomes more than 48px tall, unfix the header. * * The callback on the scroll event is only added if there is a header * image and we are not on mobile. */ if ( _window.width() > 781 ) { var mastheadHeight = $( '#masthead' ).height(), toolbarOffset, mastheadOffset; if ( mastheadHeight > 48 ) { body.removeClass( 'masthead-fixed' ); } if ( body.is( '.header-image' ) ) { toolbarOffset = body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0; mastheadOffset = $( '#masthead' ).offset().top - toolbarOffset; _window.on( 'scroll.twentyfourteen', function() { if ( ( window.scrollY > mastheadOffset ) && ( mastheadHeight < 49 ) ) { body.addClass( 'masthead-fixed' ); } else { body.removeClass( 'masthead-fixed' ); } } ); } } // Focus styles for menus. $( '.primary-navigation, .secondary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() { $( this ).parents().toggleClass( 'focus' ); } ); } ); _window.load( function() { // Arrange footer widgets vertically. if ( $.isFunction( $.fn.masonry ) ) { $( '#footer-sidebar' ).masonry( { itemSelector: '.widget', columnWidth: function( containerWidth ) { return containerWidth / 4; }, gutterWidth: 0, isResizable: true, isRTL: $( 'body' ).is( '.rtl' ) } ); } // Initialize Featured Content slider. if ( body.is( '.slider' ) ) { $( '.featured-content' ).featuredslider( { selector: '.featured-content-inner > article', controlsContainer: '.featured-content' } ); } } ); } )( jQuery );
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/js/functions.js
JavaScript
gpl3
3,393
/* * Twenty Fourteen Featured Content Slider * * Adapted from FlexSlider v2.2.0, copyright 2012 WooThemes * @link http://www.woothemes.com/flexslider/ */ /* global DocumentTouch:true,setImmediate:true,featuredSliderDefaults:true,MSGesture:true */ ( function( $ ) { // FeaturedSlider: object instance. $.featuredslider = function( el, options ) { var slider = $( el ), msGesture = window.navigator && window.navigator.msPointerEnabled && window.MSGesture, touch = ( ( 'ontouchstart' in window ) || msGesture || window.DocumentTouch && document instanceof DocumentTouch ), // MSFT specific. eventType = 'click touchend MSPointerUp', watchedEvent = '', watchedEventClearTimer, methods = {}, namespace; // Make variables public. slider.vars = $.extend( {}, $.featuredslider.defaults, options ); namespace = slider.vars.namespace, // Store a reference to the slider object. $.data( el, 'featuredslider', slider ); // Private slider methods. methods = { init: function() { slider.animating = false; slider.currentSlide = 0; slider.animatingTo = slider.currentSlide; slider.atEnd = ( slider.currentSlide === 0 || slider.currentSlide === slider.last ); slider.containerSelector = slider.vars.selector.substr( 0, slider.vars.selector.search( ' ' ) ); slider.slides = $( slider.vars.selector, slider ); slider.container = $( slider.containerSelector, slider ); slider.count = slider.slides.length; slider.prop = 'marginLeft'; slider.isRtl = $( 'body' ).hasClass( 'rtl' ); slider.args = {}; // TOUCH slider.transitions = ( function() { var obj = document.createElement( 'div' ), props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'], i; for ( i in props ) { if ( obj.style[ props[i] ] !== undefined ) { slider.pfx = props[i].replace( 'Perspective', '' ).toLowerCase(); slider.prop = '-' + slider.pfx + '-transform'; return true; } } return false; }() ); // CONTROLSCONTAINER if ( slider.vars.controlsContainer !== '' ) { slider.controlsContainer = $( slider.vars.controlsContainer ).length > 0 && $( slider.vars.controlsContainer ); } slider.doMath(); // INIT slider.setup( 'init' ); // CONTROLNAV methods.controlNav.setup(); // DIRECTIONNAV methods.directionNav.setup(); // KEYBOARD if ( $( slider.containerSelector ).length === 1 ) { $( document ).bind( 'keyup', function( event ) { var keycode = event.keyCode, target = false; if ( ! slider.animating && ( keycode === 39 || keycode === 37 ) ) { if ( keycode === 39 ) { target = slider.getTarget( 'next' ); } else if ( keycode === 37 ) { target = slider.getTarget( 'prev' ); } slider.featureAnimate( target ); } } ); } // TOUCH if ( touch ) { methods.touch(); } $( window ).bind( 'resize orientationchange focus', methods.resize ); slider.find( 'img' ).attr( 'draggable', 'false' ); }, controlNav: { setup: function() { methods.controlNav.setupPaging(); }, setupPaging: function() { var type = 'control-paging', j = 1, item, slide, i; slider.controlNavScaffold = $( '<ol class="' + namespace + 'control-nav ' + namespace + type + '"></ol>' ); if ( slider.pagingCount > 1 ) { for ( i = 0; i < slider.pagingCount; i++ ) { slide = slider.slides.eq( i ); item = '<a>' + j + '</a>'; slider.controlNavScaffold.append( '<li>' + item + '</li>' ); j++; } } // CONTROLSCONTAINER ( slider.controlsContainer ) ? $( slider.controlsContainer ).append( slider.controlNavScaffold ) : slider.append( slider.controlNavScaffold ); methods.controlNav.set(); methods.controlNav.active(); slider.controlNavScaffold.delegate( 'a, img', eventType, function( event ) { event.preventDefault(); if ( watchedEvent === '' || watchedEvent === event.type ) { var $this = $( this ), target = slider.controlNav.index( $this ); if ( ! $this.hasClass( namespace + 'active' ) ) { slider.direction = ( target > slider.currentSlide ) ? 'next' : 'prev'; slider.featureAnimate( target ); } } // Set up flags to prevent event duplication. if ( watchedEvent === '' ) { watchedEvent = event.type; } methods.setToClearWatchedEvent(); } ); }, set: function() { var selector = 'a'; slider.controlNav = $( '.' + namespace + 'control-nav li ' + selector, ( slider.controlsContainer ) ? slider.controlsContainer : slider ); }, active: function() { slider.controlNav.removeClass( namespace + 'active' ).eq( slider.animatingTo ).addClass( namespace + 'active' ); }, update: function( action, pos ) { if ( slider.pagingCount > 1 && action === 'add' ) { slider.controlNavScaffold.append( $( '<li><a>' + slider.count + '</a></li>' ) ); } else if ( slider.pagingCount === 1 ) { slider.controlNavScaffold.find( 'li' ).remove(); } else { slider.controlNav.eq( pos ).closest( 'li' ).remove(); } methods.controlNav.set(); ( slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length ) ? slider.update( pos, action ) : methods.controlNav.active(); } }, directionNav: { setup: function() { var directionNavScaffold = $( '<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + slider.vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + slider.vars.nextText + '</a></li></ul>' ); // CONTROLSCONTAINER if ( slider.controlsContainer ) { $( slider.controlsContainer ).append( directionNavScaffold ); slider.directionNav = $( '.' + namespace + 'direction-nav li a', slider.controlsContainer ); } else { slider.append( directionNavScaffold ); slider.directionNav = $( '.' + namespace + 'direction-nav li a', slider ); } methods.directionNav.update(); slider.directionNav.bind( eventType, function( event ) { event.preventDefault(); var target; if ( watchedEvent === '' || watchedEvent === event.type ) { target = ( $( this ).hasClass( namespace + 'next' ) ) ? slider.getTarget( 'next' ) : slider.getTarget( 'prev' ); slider.featureAnimate( target ); } // Set up flags to prevent event duplication. if ( watchedEvent === '' ) { watchedEvent = event.type; } methods.setToClearWatchedEvent(); } ); }, update: function() { var disabledClass = namespace + 'disabled'; if ( slider.pagingCount === 1 ) { slider.directionNav.addClass( disabledClass ).attr( 'tabindex', '-1' ); } else { slider.directionNav.removeClass( disabledClass ).removeAttr( 'tabindex' ); } } }, touch: function() { var startX, startY, offset, cwidth, dx, startT, scrolling = false, localX = 0, localY = 0, accDx = 0; if ( ! msGesture ) { el.addEventListener( 'touchstart', onTouchStart, false ); } else { el.style.msTouchAction = 'none'; el._gesture = new MSGesture(); // MSFT specific. el._gesture.target = el; el.addEventListener( 'MSPointerDown', onMSPointerDown, false ); el._slider = slider; el.addEventListener( 'MSGestureChange', onMSGestureChange, false ); el.addEventListener( 'MSGestureEnd', onMSGestureEnd, false ); } function onTouchStart( e ) { if ( slider.animating ) { e.preventDefault(); } else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) { cwidth = slider.w; startT = Number( new Date() ); // Local vars for X and Y points. localX = e.touches[0].pageX; localY = e.touches[0].pageY; offset = ( slider.currentSlide + slider.cloneOffset ) * cwidth; if ( slider.animatingTo === slider.last && slider.direction !== 'next' ) { offset = 0; } startX = localX; startY = localY; el.addEventListener( 'touchmove', onTouchMove, false ); el.addEventListener( 'touchend', onTouchEnd, false ); } } function onTouchMove( e ) { // Local vars for X and Y points. localX = e.touches[0].pageX; localY = e.touches[0].pageY; dx = startX - localX; scrolling = Math.abs( dx ) < Math.abs( localY - startY ); if ( ! scrolling ) { e.preventDefault(); if ( slider.transitions ) { slider.setProps( offset + dx, 'setTouch' ); } } } function onTouchEnd() { // Finish the touch by undoing the touch session. el.removeEventListener( 'touchmove', onTouchMove, false ); if ( slider.animatingTo === slider.currentSlide && ! scrolling && dx !== null ) { var updateDx = dx, target = ( updateDx > 0 ) ? slider.getTarget( 'next' ) : slider.getTarget( 'prev' ); slider.featureAnimate( target ); } el.removeEventListener( 'touchend', onTouchEnd, false ); startX = null; startY = null; dx = null; offset = null; } function onMSPointerDown( e ) { e.stopPropagation(); if ( slider.animating ) { e.preventDefault(); } else { el._gesture.addPointer( e.pointerId ); accDx = 0; cwidth = slider.w; startT = Number( new Date() ); offset = ( slider.currentSlide + slider.cloneOffset ) * cwidth; if ( slider.animatingTo === slider.last && slider.direction !== 'next' ) { offset = 0; } } } function onMSGestureChange( e ) { e.stopPropagation(); var slider = e.target._slider, transX, transY; if ( ! slider ) { return; } transX = -e.translationX, transY = -e.translationY; // Accumulate translations. accDx = accDx + transX; dx = accDx; scrolling = Math.abs( accDx ) < Math.abs( -transY ); if ( e.detail === e.MSGESTURE_FLAG_INERTIA ) { setImmediate( function () { // MSFT specific. el._gesture.stop(); } ); return; } if ( ! scrolling || Number( new Date() ) - startT > 500 ) { e.preventDefault(); if ( slider.transitions ) { slider.setProps( offset + dx, 'setTouch' ); } } } function onMSGestureEnd( e ) { e.stopPropagation(); var slider = e.target._slider, updateDx, target; if ( ! slider ) { return; } if ( slider.animatingTo === slider.currentSlide && ! scrolling && dx !== null ) { updateDx = dx, target = ( updateDx > 0 ) ? slider.getTarget( 'next' ) : slider.getTarget( 'prev' ); slider.featureAnimate( target ); } startX = null; startY = null; dx = null; offset = null; accDx = 0; } }, resize: function() { if ( ! slider.animating && slider.is( ':visible' ) ) { slider.doMath(); // SMOOTH HEIGHT methods.smoothHeight(); slider.newSlides.width( slider.computedW ); slider.setProps( slider.computedW, 'setTotal' ); } }, smoothHeight: function( dur ) { var $obj = slider.viewport; ( dur ) ? $obj.animate( { 'height': slider.slides.eq( slider.animatingTo ).height() }, dur ) : $obj.height( slider.slides.eq( slider.animatingTo ).height() ); }, setToClearWatchedEvent: function() { clearTimeout( watchedEventClearTimer ); watchedEventClearTimer = setTimeout( function() { watchedEvent = ''; }, 3000 ); } }; // Public methods. slider.featureAnimate = function( target ) { if ( target !== slider.currentSlide ) { slider.direction = ( target > slider.currentSlide ) ? 'next' : 'prev'; } if ( ! slider.animating && slider.is( ':visible' ) ) { slider.animating = true; slider.animatingTo = target; // CONTROLNAV methods.controlNav.active(); slider.slides.removeClass( namespace + 'active-slide' ).eq( target ).addClass( namespace + 'active-slide' ); slider.atEnd = target === 0 || target === slider.last; // DIRECTIONNAV methods.directionNav.update(); var dimension = slider.computedW, slideString; if ( slider.currentSlide === 0 && target === slider.count - 1 && slider.direction !== 'next' ) { slideString = 0; } else if ( slider.currentSlide === slider.last && target === 0 && slider.direction !== 'prev' ) { slideString = ( slider.count + 1 ) * dimension; } else { slideString = ( target + slider.cloneOffset ) * dimension; } slider.setProps( slideString, '', slider.vars.animationSpeed ); if ( slider.transitions ) { if ( ! slider.atEnd ) { slider.animating = false; slider.currentSlide = slider.animatingTo; } slider.container.unbind( 'webkitTransitionEnd transitionend' ); slider.container.bind( 'webkitTransitionEnd transitionend', function() { slider.wrapup( dimension ); } ); } else { slider.container.animate( slider.args, slider.vars.animationSpeed, 'swing', function() { slider.wrapup( dimension ); } ); } // SMOOTH HEIGHT methods.smoothHeight( slider.vars.animationSpeed ); } }; slider.wrapup = function( dimension ) { if ( slider.currentSlide === 0 && slider.animatingTo === slider.last ) { slider.setProps( dimension, 'jumpEnd' ); } else if ( slider.currentSlide === slider.last && slider.animatingTo === 0 ) { slider.setProps( dimension, 'jumpStart' ); } slider.animating = false; slider.currentSlide = slider.animatingTo; }; slider.getTarget = function( dir ) { slider.direction = dir; // Swap for RTL. if ( slider.isRtl ) { dir = 'next' === dir ? 'prev' : 'next'; } if ( dir === 'next' ) { return ( slider.currentSlide === slider.last ) ? 0 : slider.currentSlide + 1; } else { return ( slider.currentSlide === 0 ) ? slider.last : slider.currentSlide - 1; } }; slider.setProps = function( pos, special, dur ) { var target = ( function() { var posCalc = ( function() { switch ( special ) { case 'setTotal': return ( slider.currentSlide + slider.cloneOffset ) * pos; case 'setTouch': return pos; case 'jumpEnd': return slider.count * pos; case 'jumpStart': return pos; default: return pos; } }() ); return ( posCalc * -1 ) + 'px'; }() ); if ( slider.transitions ) { target = 'translate3d(' + target + ',0,0 )'; dur = ( dur !== undefined ) ? ( dur / 1000 ) + 's' : '0s'; slider.container.css( '-' + slider.pfx + '-transition-duration', dur ); } slider.args[slider.prop] = target; if ( slider.transitions || dur === undefined ) { slider.container.css( slider.args ); } }; slider.setup = function( type ) { var sliderOffset; if ( type === 'init' ) { slider.viewport = $( '<div class="' + namespace + 'viewport"></div>' ).css( { 'overflow': 'hidden', 'position': 'relative' } ).appendTo( slider ).append( slider.container ); slider.cloneCount = 0; slider.cloneOffset = 0; } slider.cloneCount = 2; slider.cloneOffset = 1; // Clear out old clones. if ( type !== 'init' ) { slider.container.find( '.clone' ).remove(); } slider.container.append( slider.slides.first().clone().addClass( 'clone' ).attr( 'aria-hidden', 'true' ) ).prepend( slider.slides.last().clone().addClass( 'clone' ).attr( 'aria-hidden', 'true' ) ); slider.newSlides = $( slider.vars.selector, slider ); sliderOffset = slider.currentSlide + slider.cloneOffset; slider.container.width( ( slider.count + slider.cloneCount ) * 200 + '%' ); slider.setProps( sliderOffset * slider.computedW, 'init' ); setTimeout( function() { slider.doMath(); slider.newSlides.css( { 'width': slider.computedW, 'float': 'left', 'display': 'block' } ); // SMOOTH HEIGHT methods.smoothHeight(); }, ( type === 'init' ) ? 100 : 0 ); slider.slides.removeClass( namespace + 'active-slide' ).eq( slider.currentSlide ).addClass( namespace + 'active-slide' ); }; slider.doMath = function() { var slide = slider.slides.first(); slider.w = ( slider.viewport===undefined ) ? slider.width() : slider.viewport.width(); slider.h = slide.height(); slider.boxPadding = slide.outerWidth() - slide.width(); slider.itemW = slider.w; slider.pagingCount = slider.count; slider.last = slider.count - 1; slider.computedW = slider.itemW - slider.boxPadding; }; slider.update = function( pos, action ) { slider.doMath(); // Update currentSlide and slider.animatingTo if necessary. if ( pos < slider.currentSlide ) { slider.currentSlide += 1; } else if ( pos <= slider.currentSlide && pos !== 0 ) { slider.currentSlide -= 1; } slider.animatingTo = slider.currentSlide; // Update controlNav. if ( action === 'add' || slider.pagingCount > slider.controlNav.length ) { methods.controlNav.update( 'add' ); } else if ( action === 'remove' || slider.pagingCount < slider.controlNav.length ) { if ( slider.currentSlide > slider.last ) { slider.currentSlide -= 1; slider.animatingTo -= 1; } methods.controlNav.update( 'remove', slider.last ); } // Update directionNav. methods.directionNav.update(); }; // FeaturedSlider: initialize. methods.init(); }; // Default settings. $.featuredslider.defaults = { namespace: 'slider-', // String: prefix string attached to the class of every element generated by the plugin. selector: '.slides > li', // String: selector, must match a simple pattern. animationSpeed: 600, // Integer: Set the speed of animations, in milliseconds. controlsContainer: '', // jQuery Object/Selector: container navigation to append elements. // Text labels. prevText: featuredSliderDefaults.prevText, // String: Set the text for the "previous" directionNav item. nextText: featuredSliderDefaults.nextText // String: Set the text for the "next" directionNav item. }; // FeaturedSlider: plugin function. $.fn.featuredslider = function( options ) { if ( options === undefined ) { options = {}; } if ( typeof options === 'object' ) { return this.each( function() { var $this = $( this ), selector = ( options.selector ) ? options.selector : '.slides > li', $slides = $this.find( selector ); if ( $slides.length === 1 || $slides.length === 0 ) { $slides.fadeIn( 400 ); } else if ( $this.data( 'featuredslider' ) === undefined ) { new $.featuredslider( this, options ); } } ); } }; } )( jQuery );
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/js/slider.js
JavaScript
gpl3
18,799
/** * Twenty Fourteen Featured Content admin behavior: add a tag suggestion * when changing the tag. */ /* global ajaxurl:true */ jQuery( document ).ready( function( $ ) { $( '#customize-control-featured-content-tag-name input' ).suggest( ajaxurl + '?action=ajax-tag-search&tax=post_tag', { delay: 500, minchars: 2 } ); });
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/js/featured-content-admin.js
JavaScript
gpl3
329
<?php /** * The template for displaying Tag pages * * Used to display archive-type pages for posts in a tag. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <section id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"><?php printf( __( 'Tag Archives: %s', 'twentyfourteen' ), single_tag_title( '', false ) ); ?></h1> <?php // Show an optional term description. $term_description = term_description(); if ( ! empty( $term_description ) ) : printf( '<div class="taxonomy-description">%s</div>', $term_description ); endif; ?> </header><!-- .archive-header --> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/tag.php
PHP
gpl3
1,593
<?php /** * The template for displaying posts in the Video post format * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php twentyfourteen_post_thumbnail(); ?> <header class="entry-header"> <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> <?php endif; if ( is_single() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; ?> <div class="entry-meta"> <span class="post-format"> <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'video' ) ); ?>"><?php echo get_post_format_string( 'video' ); ?></a> </span> <?php twentyfourteen_posted_on(); ?> <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> </article><!-- #post-## -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/content-video.php
PHP
gpl3
2,167
<?php /** * Template Name: Contributor Page * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="main-content" class="main-content"> <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); // Output the authors list. twentyfourteen_list_authors(); edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> </article><!-- #post-## --> <?php // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } endwhile; ?> </div><!-- #content --> </div><!-- #primary --> </div><!-- #main-content --> <?php get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/page-templates/contributors.php
PHP
gpl3
1,296
<?php /** * Template Name: Full Width Page * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="main-content" class="main-content"> <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); // Include the page content template. get_template_part( 'content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } endwhile; ?> </div><!-- #content --> </div><!-- #primary --> </div><!-- #main-content --> <?php get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/page-templates/full-width.php
PHP
gpl3
939
/* Theme Name: Twenty Fourteen Description: Adds support for languages written in a Right To Left (RTL) direction. It's easy, just a matter of overwriting all the horizontal positioning attributes of your CSS stylesheet in a separate stylesheet file named rtl.css. See http://codex.wordpress.org/Right_to_Left_Language_Support */ /** * Table of Contents: * * 1.0 - Reset * 2.0 - Repeatable Patterns * 4.0 - Header * 5.0 - Navigation * 6.0 - Content * 6.3 - Entry Meta * 6.4 - Entry Content * 6.5 - Galleries * 6.7 - Post/Image/Paging Navigation * 6.10 - Contributor Page * 6.14 - Comments * 7.0 - Sidebar * 7.1 - Widgets * 7.2 - Content Sidebar Widgets * 9.0 - Featured Content * 10.0 - Media Queries * ----------------------------------------------------------------------------- */ /** * 1.0 Reset * ----------------------------------------------------------------------------- */ body { direction: rtl; unicode-bidi: embed; } a { display: inline-block; } ul, ol { margin: 0 20px 24px 0; } li > ul, li > ol { margin: 0 20px 0 0; } caption, th, td { text-align: right; } /** * 2.0 Repeatable Patterns * ----------------------------------------------------------------------------- */ .wp-caption-text { padding-left: 10px; padding-right: 0; } .screen-reader-text:focus { right: 5px; left: auto; } /** * 4.0 Header * ----------------------------------------------------------------------------- */ .site-title { float: right; } .search-toggle { float: left; margin-left: 38px; margin-right: auto; } .search-box .search-field { float: left; padding: 1px 6px 2px 2px; } .search-toggle .screen-reader-text { right: 5px; /* Avoid a horizontal scrollbar when the site has a long menu */ left: auto; } /** * 5.0 Navigation * ----------------------------------------------------------------------------- */ .site-navigation ul ul { margin-right: 20px; margin-left: auto; } .menu-toggle { right: auto; left: 0; } /** * 6.0 Content * ----------------------------------------------------------------------------- */ /** * 6.3 Entry Meta * ----------------------------------------------------------------------------- */ .entry-meta .tag-links a { margin: 0 10px 4px 4px; } .entry-meta .tag-links a:before { border-right: 0; border-left: 8px solid #767676; right: -7px; left: auto; } .entry-meta .tag-links a:hover:before, .entry-meta .tag-links a:focus:before { border-left-color: #41a62a; } .entry-meta .tag-links a:after { right: -2px; left: auto; } /** * 6.4 Entry Content * ----------------------------------------------------------------------------- */ .page-links a, .page-links > span { margin: 0 0 2px 1px; } .page-links > .page-links-title { padding-right: 0; padding-left: 7px; } /** * 6.5 Galleries * ----------------------------------------------------------------------------- */ .gallery-item { float: right; margin: 0 0 4px 4px; } .gallery-columns-1 .gallery-item:nth-of-type(1n), .gallery-columns-2 .gallery-item:nth-of-type(2n), .gallery-columns-3 .gallery-item:nth-of-type(3n), .gallery-columns-4 .gallery-item:nth-of-type(4n), .gallery-columns-5 .gallery-item:nth-of-type(5n), .gallery-columns-6 .gallery-item:nth-of-type(6n), .gallery-columns-7 .gallery-item:nth-of-type(7n), .gallery-columns-8 .gallery-item:nth-of-type(8n), .gallery-columns-9 .gallery-item:nth-of-type(9n) { margin-right: auto; margin-left: 0; } .gallery-caption { padding: 6px 8px; right: 0; left: auto; text-align: right; } .gallery-caption:before { right: 0; left: auto; } /** * 6.7 Post/Image/Paging Navigation * ----------------------------------------------------------------------------- */ .paging-navigation .page-numbers { margin-right: auto; margin-left: 1px; } /** * 6.10 Contributor Page * ----------------------------------------------------------------------------- */ .contributor-avatar { float: right; margin: 0 0 20px 30px; } /** * 6.14 Comments * ----------------------------------------------------------------------------- */ .comment-author .avatar { right: 0; left: auto; } .bypostauthor > article .fn:before { margin: 0 -2px 0 2px; } .comment-author, .comment-awaiting-moderation, .comment-content, .comment-list .reply, .comment-metadata { padding-right: 30px; padding-left: 0; } .comment-edit-link { margin-right: 10px; margin-left: auto; } .comment-reply-link:before, .comment-reply-login:before { margin-left: auto; margin-right: 2px; } .comment-reply-link:before, .comment-reply-login:before, .comment-edit-link:before { -webkit-transform: scaleX(-1); -moz-transform: scaleX(-1); -ms-transform: scaleX(-1); -o-transform: scaleX(-1); transform: scaleX(-1); } .comment-content ul, .comment-content ol { margin: 0 22px 24px 0; } .comment-list .children { margin-right: 15px; margin-left: auto; } .comment-reply-title small a { float: left; } .comment-navigation .nav-previous a { margin-right: auto; margin-left: 10px; } /** * 7.0 Sidebars * ----------------------------------------------------------------------------- */ /** * 7.1 Widgets * ----------------------------------------------------------------------------- */ .widget li > ol, .widget li > ul { margin-right: 10px; margin-left: auto; } .widget input, .widget textarea { padding: 1px 4px 2px 2px; } .widget_calendar caption { text-align: right; } .widget_calendar #prev { padding-right: 5px; padding-left: 0; } .widget_calendar #next { padding-right: 0; padding-left: 5px; text-align: left; } .widget_twentyfourteen_ephemera .entry-content ul, .widget_twentyfourteen_ephemera .entry-content ol { margin: 0 20px 18px 0; } .widget_twentyfourteen_ephemera .entry-content li > ul, .widget_twentyfourteen_ephemera .entry-content li > ol { margin: 0 20px 0 0; } /** * 7.2 Content Sidebar Widgets * ----------------------------------------------------------------------------- */ .content-sidebar .widget li > ol, .content-sidebar .widget li > ul { margin-right: 18px; margin-left: auto; } .content-sidebar .widget_twentyfourteen_ephemera .widget-title:before { margin: -1px 0 0 18px; } /** * 9.0 Featured Content * ----------------------------------------------------------------------------- */ .featured-content .post-thumbnail img { right: 0; left: auto; } .slider-viewport { direction: ltr; } .slider .featured-content .entry-header { right: 0; left: auto; text-align: right; } .slider-control-paging { float: right; } .slider-control-paging li { float: right; margin: 2px 0 2px 4px; } .slider-control-paging li:last-child { margin-right: auto; margin-left: 0; } .slider-control-paging a:before { right: 10px; left: auto; } .slider-direction-nav li { border-width: 2px 0 0 1px; float: right; } .slider-direction-nav li:last-child { border-width: 2px 1px 0 0; } .slider-direction-nav a:before { content: "\f429"; } .slider-direction-nav .slider-next:before { content: "\f430"; } /** * 10.0 Media Queries * ----------------------------------------------------------------------------- */ @media screen and (max-width: 400px) { .list-view .site-content .post-thumbnail img { float: right; margin: 0 0 3px 10px; } } @media screen and (min-width: 401px) { .site-content .entry-meta > span { margin-right: auto; margin-left: 10px; } .site-content .format-quote .post-format a:before { margin-right: auto; margin-left: 2px; } .site-content .format-gallery .post-format a:before { margin-right: auto; margin-left: 4px; } .site-content .format-aside .post-format a:before { margin-right: auto; margin-left: 2px; } .site-content .featured-post:before { margin-right: auto; margin-left: 3px; } .site-content .entry-date a:before, .attachment .site-content span.entry-date:before { margin-right: auto; margin-left: 1px; } .site-content .comments-link a:before { margin-right: auto; margin-left: 2px; } .site-content .full-size-link a:before { margin-right: auto; margin-left: 1px; } .entry-content .edit-link a:before, .entry-meta .edit-link a:before { -webkit-transform: scaleX(-1); -moz-transform: scaleX(-1); -ms-transform: scaleX(-1); -o-transform: scaleX(-1); transform: scaleX(-1); } } @media screen and (min-width: 594px) { .site-content .entry-header { padding-right: 30px; padding-left: 30px; } } @media screen and (min-width: 673px) { .search-toggle { margin-right: auto; margin-left: 18px; } .content-area { float: right; } .site-content { margin-right: auto; margin-left: 33.33333333%; } .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { padding-right: 30px; padding-left: 30px; } .full-width .site-content { margin-left: 0; } .content-sidebar { float: left; margin-right: -33.33333333%; margin-left: auto; } .grid .featured-content .hentry { float: right; } .slider-control-paging { padding-right: 20px; padding-left: 0; } .slider-direction-nav { float: left; } .slider-direction-nav li { padding: 0 0 0 1px; } .slider-direction-nav li:last-child { padding: 0 1px 0 0; } } @media screen and (min-width: 783px) { .header-main { padding-right: 30px; padding-left: 0; } .search-toggle { margin-right: auto; margin-left: 0; } .primary-navigation { float: left; margin: 0 -12px 0 1px; } .primary-navigation ul ul { float: right; margin: 0; right: -999em; left: auto; } .primary-navigation ul ul ul { right: -999em; left: auto; } .primary-navigation ul li:hover > ul, .primary-navigation ul li.focus > ul { right: auto; } .primary-navigation ul ul li:hover > ul, .primary-navigation ul ul li.focus > ul { right: 100%; left: auto; } .primary-navigation .menu-item-has-children > a, .primary-navigation .page_item_has_children > a { padding-right: 12px; padding-left: 26px; } .primary-navigation .menu-item-has-children > a:after, .primary-navigation .page_item_has_children > a:after { right: auto; left: 12px; } .primary-navigation li .menu-item-has-children > a, .primary-navigation li .page_item_has_children > a { padding-right: 12px; padding-left: 20px; } .primary-navigation .menu-item-has-children li.menu-item-has-children > a:after, .primary-navigation .menu-item-has-children li.page_item_has_children > a:after, .primary-navigation .page_item_has_children li.menu-item-has-children > a:after, .primary-navigation .page_item_has_children li.page_item_has_children > a:after { content: "\f503"; right: auto; left: 8px; } } @media screen and (min-width: 810px) { .attachment .entry-attachment .attachment { margin-right: -168px; margin-left: -168px; } .attachment .entry-attachment .attachment a { display: block; } .contributor-avatar { margin-right: -168px; margin-left: auto; } .contributor-summary { float: right; } .full-width .site-content blockquote.alignright, .full-width .site-content img.size-full.alignright, .full-width .site-content img.size-large.alignright, .full-width .site-content img.size-medium.alignright, .full-width .site-content .wp-caption.alignright { margin-right: -168px; margin-left: auto; } .full-width .site-content blockquote.alignleft, .full-width .site-content img.size-full.alignleft, .full-width .site-content img.size-large.alignleft, .full-width .site-content img.size-medium.alignleft, .full-width .site-content .wp-caption.alignleft { margin-right: auto; margin-left: -168px; } } @media screen and (min-width: 846px) { .comment-author, .comment-awaiting-moderation, .comment-content, .comment-list .reply, .comment-metadata { padding-right: 50px; padding-left: 0; } .comment-list .children { margin-right: 20px; margin-left: auto; } } @media screen and (min-width: 1008px) { .search-box-wrapper { padding-right: 182px; padding-left: 0; } .main-content { float: right; } .site-content { margin-right: 182px; margin-left: 29.04761904%; } .full-width .site-content { margin-right: 182px; } .content-sidebar { margin-right: -29.04761904%; margin-left: auto; } .site:before { right: 0; left: auto; } #secondary { float: right; margin: 0 -100% 0 0; } .secondary-navigation ul ul { right: -999em; left: auto; } .secondary-navigation ul li:hover > ul, .secondary-navigation ul li.focus > ul { right: 162px; left: auto; } .secondary-navigation .menu-item-has-children > a { padding-right: 30px; padding-left: 38px; } .secondary-navigation .menu-item-has-children > a:after { border-right-color: #fff; border-left-color: transparent; right: auto; left: 26px; content: "\f503"; } .footer-sidebar .widget { float: right; } .featured-content { padding-right: 182px; padding-left: 0; } } @media screen and (min-width: 1040px) { .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { padding-right: 15px; padding-left: 15px; } .full-width .archive-header, .full-width .comments-area, .full-width .image-navigation, .full-width .page-header, .full-width .page-content, .full-width .post-navigation, .full-width .site-content .entry-header, .full-width .site-content .entry-content, .full-width .site-content .entry-summary, .full-width .site-content footer.entry-meta { padding-right: 30px; padding-left: 30px; } } @media screen and (min-width: 1080px) { .site-content { margin-right: 222px; margin-left: 29.04761904%; } .full-width .site-content { margin-right: 222px; } .search-box-wrapper, .featured-content { padding-right: 222px; padding-left: 0; } .secondary-navigation ul li:hover > ul, .secondary-navigation ul li.focus > ul { right: 202px; left: auto; } .slider-control-paging { padding-right: 24px; padding-left: 0; } .slider-control-paging li { margin: 12px 0 12px 12px; } .slider-control-paging a:before { right: 6px; left: auto; } } @media screen and (min-width: 1110px) { .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { padding-right: 30px; padding-left: 30px; } } @media screen and (min-width: 1218px) { .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { margin-left: 54px; } .full-width .archive-header, .full-width .comments-area, .full-width .image-navigation, .full-width .page-header, .full-width .page-content, .full-width .post-navigation, .full-width .site-content .entry-header, .full-width .site-content .entry-content, .full-width .site-content .entry-summary, .full-width .site-content footer.entry-meta { margin-right: auto; margin-left: auto; } } @media screen and (min-width: 1260px) { .site-content blockquote.alignright { margin-right: -18%; margin-left: auto; } .site-content blockquote.alignleft { margin-left: -18%; margin-right: auto; } }
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/rtl.css
CSS
gpl3
15,578
<?php /** * The template for displaying posts in the Image post format * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php twentyfourteen_post_thumbnail(); ?> <header class="entry-header"> <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> <?php endif; if ( is_single() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; ?> <div class="entry-meta"> <span class="post-format"> <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'image' ) ); ?>"><?php echo get_post_format_string( 'image' ); ?></a> </span> <?php twentyfourteen_posted_on(); ?> <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> </article><!-- #post-## -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/content-image.php
PHP
gpl3
2,167
<?php /** * The template for displaying Author archive pages * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <section id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"> <?php /* * Queue the first post, that way we know what author * we're dealing with (if that is the case). * * We reset this later so we can run the loop properly * with a call to rewind_posts(). */ the_post(); printf( __( 'All posts by %s', 'twentyfourteen' ), get_the_author() ); ?> </h1> <?php if ( get_the_author_meta( 'description' ) ) : ?> <div class="author-description"><?php the_author_meta( 'description' ); ?></div> <?php endif; ?> </header><!-- .archive-header --> <?php /* * Since we called the_post() above, we need to rewind * the loop back to the beginning that way we can run * the loop properly, in full. */ rewind_posts(); // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/author.php
PHP
gpl3
1,927
<?php /** * The template for displaying the footer * * Contains footer content and the closing of the #main and #page div elements. * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> </div><!-- #main --> <footer id="colophon" class="site-footer" role="contentinfo"> <?php get_sidebar( 'footer' ); ?> <div class="site-info"> <?php do_action( 'twentyfourteen_credits' ); ?> <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyfourteen' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyfourteen' ), 'WordPress' ); ?></a> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html>
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/footer.php
PHP
gpl3
728
<?php /** * The template for displaying Archive pages * * Used to display archive-type pages if nothing more specific matches a query. * For example, puts together date-based pages if no date.php file exists. * * If you'd like to further customize these archive views, you may create a * new template file for each specific one. For example, Twenty Fourteen * already has tag.php for Tag archives, category.php for Category archives, * and author.php for Author archives. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <section id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"> <?php if ( is_day() ) : printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() ); elseif ( is_month() ) : printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) ) ); elseif ( is_year() ) : printf( __( 'Yearly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyfourteen' ) ) ); else : _e( 'Archives', 'twentyfourteen' ); endif; ?> </h1> </header><!-- .page-header --> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/archive.php
PHP
gpl3
2,161
<?php /** * The template for displaying Post Format pages * * Used to display archive-type pages for posts with a post format. * If you'd like to further customize these Post Format views, you may create a * new template file for each specific one. * * @todo http://core.trac.wordpress.org/ticket/23257: Add plural versions of Post Format strings * and remove plurals below. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <section id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"> <?php if ( is_tax( 'post_format', 'post-format-aside' ) ) : _e( 'Asides', 'twentyfourteen' ); elseif ( is_tax( 'post_format', 'post-format-image' ) ) : _e( 'Images', 'twentyfourteen' ); elseif ( is_tax( 'post_format', 'post-format-video' ) ) : _e( 'Videos', 'twentyfourteen' ); elseif ( is_tax( 'post_format', 'post-format-audio' ) ) : _e( 'Audio', 'twentyfourteen' ); elseif ( is_tax( 'post_format', 'post-format-quote' ) ) : _e( 'Quotes', 'twentyfourteen' ); elseif ( is_tax( 'post_format', 'post-format-link' ) ) : _e( 'Links', 'twentyfourteen' ); elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) : _e( 'Galleries', 'twentyfourteen' ); else : _e( 'Archives', 'twentyfourteen' ); endif; ?> </h1> </header><!-- .archive-header --> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/taxonomy-post_format.php
PHP
gpl3
2,363
<?php /** * The template for displaying Category pages * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <section id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentyfourteen' ), single_cat_title( '', false ) ); ?></h1> <?php // Show an optional term description. $term_description = term_description(); if ( ! empty( $term_description ) ) : printf( '<div class="taxonomy-description">%s</div>', $term_description ); endif; ?> </header><!-- .archive-header --> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/category.php
PHP
gpl3
1,536
<?php /** * The default template for displaying content * * Used for both single and index/archive/search. * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php twentyfourteen_post_thumbnail(); ?> <header class="entry-header"> <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?> <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div> <?php endif; if ( is_single() ) : the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; ?> <div class="entry-meta"> <?php if ( 'post' == get_post_type() ) twentyfourteen_posted_on(); if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> <?php endif; edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-meta --> </header><!-- .entry-header --> <?php if ( is_search() ) : ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> </article><!-- #post-## -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/content.php
PHP
gpl3
2,184
/* Theme Name: Twenty Fourteen Theme URI: http://wordpress.org/themes/twentyfourteen Author: the WordPress team Author URI: http://wordpress.org/ Description: In 2014, our default theme lets you create a responsive magazine website with a sleek, modern design. Feature your favorite homepage content in either a grid or a slider. Use the three widget areas to customize your website, and change your content's layout with a full-width page template and a contributor page to show off your authors. Creating a magazine website with WordPress has never been easier. Version: 1.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: black, green, white, light, dark, two-columns, three-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready Text Domain: twentyfourteen This theme, like WordPress, is licensed under the GPL. Use it to make something cool, have fun, and share what you've learned with others. */ /** * Table of Contents: * * 1.0 - Reset * 2.0 - Repeatable Patterns * 3.0 - Basic Structure * 4.0 - Header * 5.0 - Navigation * 6.0 - Content * 6.1 - Post Thumbnail * 6.2 - Entry Header * 6.3 - Entry Meta * 6.4 - Entry Content * 6.5 - Galleries * 6.6 - Post Formats * 6.7 - Post/Image/Paging Navigation * 6.8 - Attachments * 6.9 - Archives * 6.10 - Contributor Page * 6.11 - 404 Page * 6.12 - Full-width * 6.13 - Singular * 6.14 - Comments * 7.0 - Sidebar * 7.1 - Widgets * 7.2 - Content Sidebar Widgets * 8.0 - Footer * 9.0 - Featured Content * 10.0 - Multisite * 11.0 - Media Queries * 12.0 - Print * ----------------------------------------------------------------------------- */ /** * 1.0 Reset * * Resetting and rebuilding styles have been helped along thanks to the fine * work of Eric Meyer http://meyerweb.com/eric/tools/css/reset/index.html * along with Nicolas Gallagher and Jonathan Neal * http://necolas.github.com/normalize.css/ and Blueprint * http://www.blueprintcss.org/ * * ----------------------------------------------------------------------------- */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { border: 0; font-family: inherit; font-size: 100%; font-style: inherit; font-weight: inherit; margin: 0; outline: 0; padding: 0; vertical-align: baseline; } article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } audio, canvas, video { display: inline-block; max-width: 100%; } html { overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body, button, input, select, textarea { color: #2b2b2b; font-family: Lato, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; } body { background: #f5f5f5; } a { color: #24890d; text-decoration: none; } a:focus { outline: thin dotted; } a:hover, a:active { outline: 0; } a:active, a:hover { color: #41a62a; } h1, h2, h3, h4, h5, h6 { clear: both; font-weight: 700; margin: 36px 0 12px; } h1 { font-size: 26px; line-height: 1.3846153846; } h2 { font-size: 24px; line-height: 1; } h3 { font-size: 22px; line-height: 1.0909090909; } h4 { font-size: 20px; line-height: 1.2; } h5 { font-size: 18px; line-height: 1.3333333333; } h6 { font-size: 16px; line-height: 1.5; } address { font-style: italic; margin-bottom: 24px; } abbr[title] { border-bottom: 1px dotted #2b2b2b; cursor: help; } b, strong { font-weight: 700; } cite, dfn, em, i { font-style: italic; } mark, ins { background: #fff9c0; text-decoration: none; } p { margin-bottom: 24px; } code, kbd, tt, var, samp, pre { font-family: monospace, serif; font-size: 15px; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; line-height: 1.6; } pre { border: 1px solid rgba(0, 0, 0, 0.1); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin-bottom: 24px; max-width: 100%; overflow: auto; padding: 12px; white-space: pre; white-space: pre-wrap; word-wrap: break-word; } blockquote, q { -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; } blockquote { color: #767676; font-size: 19px; font-style: italic; font-weight: 300; line-height: 1.2631578947; margin-bottom: 24px; } blockquote cite, blockquote small { color: #2b2b2b; font-size: 16px; font-weight: 400; line-height: 1.5; } blockquote em, blockquote i, blockquote cite { font-style: normal; } blockquote strong, blockquote b { font-weight: 400; } small { font-size: smaller; } big { font-size: 125%; } sup, sub { font-size: 75%; height: 0; line-height: 0; position: relative; vertical-align: baseline; } sup { bottom: 1ex; } sub { top: .5ex; } dl { margin-bottom: 24px; } dt { font-weight: bold; } dd { margin-bottom: 24px; } ul, ol { list-style: none; margin: 0 0 24px 20px; } ul { list-style: disc; } ol { list-style: decimal; } li > ul, li > ol { margin: 0 0 0 20px; } img { -ms-interpolation-mode: bicubic; border: 0; vertical-align: middle; } figure { margin: 0; } fieldset { border: 1px solid rgba(0, 0, 0, 0.1); margin: 0 0 24px; padding: 11px 12px 0; } legend { white-space: normal; } button, input, select, textarea { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-size: 100%; margin: 0; max-width: 100%; vertical-align: baseline; } button, input { line-height: normal; } input, textarea { background-image: -webkit-linear-gradient(hsla(0,0%,100%,0), hsla(0,0%,100%,0)); /* Removing the inner shadow, rounded corners on iOS inputs */ } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], input[disabled] { cursor: default; } input[type="checkbox"], input[type="radio"] { padding: 0; } input[type="search"] { -webkit-appearance: textfield; } input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } textarea { overflow: auto; vertical-align: top; } table, th, td { border: 1px solid rgba(0, 0, 0, 0.1); } table { border-collapse: separate; border-spacing: 0; border-width: 1px 0 0 1px; margin-bottom: 24px; width: 100%; } caption, th, td { font-weight: normal; text-align: left; } th { border-width: 0 1px 1px 0; font-weight: bold; } td { border-width: 0 1px 1px 0; } del { color: #767676; } hr { background-color: rgba(0, 0, 0, 0.1); border: 0; height: 1px; margin-bottom: 23px; } /* Support a widely-adopted but non-standard selector for text selection styles * to achieve a better experience. See http://core.trac.wordpress.org/ticket/25898. */ ::selection { background: #24890d; color: #fff; text-shadow: none; } ::-moz-selection { background: #24890d; color: #fff; text-shadow: none; } /** * 2.0 Repeatable Patterns * ----------------------------------------------------------------------------- */ /* Input fields */ input, textarea { border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 2px; color: #2b2b2b; padding: 8px 10px 7px; } textarea { width: 100%; } input:focus, textarea:focus { border: 1px solid rgba(0, 0, 0, 0.3); outline: 0; } /* Buttons */ button, .button, input[type="button"], input[type="reset"], input[type="submit"] { background-color: #24890d; border: 0; border-radius: 2px; color: #fff; font-size: 12px; font-weight: 700; padding: 10px 30px 11px; text-transform: uppercase; vertical-align: bottom; } button:hover, button:focus, .button:hover, .button:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="reset"]:hover, input[type="reset"]:focus, input[type="submit"]:hover, input[type="submit"]:focus { background-color: #41a62a; color: #fff; } button:active, .button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active { background-color: #55d737; } .search-field { width: 100%; } .search-submit { display: none; } /* Placeholder text color -- selectors need to be separate to work. */ ::-webkit-input-placeholder { color: #939393; } :-moz-placeholder { color: #939393; } ::-moz-placeholder { color: #939393; opacity: 1; /* Since FF19 lowers the opacity of the placeholder by default */ } :-ms-input-placeholder { color: #939393; } /* Responsive images. Fluid images for posts, comments, and widgets */ .comment-content img, .entry-content img, .entry-summary img, #site-header img, .widget img, .wp-caption { max-width: 100%; } /** * Make sure images with WordPress-added height and width attributes are * scaled correctly. */ .comment-content img[height], .entry-content img, .entry-summary img, img[class*="align"], img[class*="wp-image-"], img[class*="attachment-"], #site-header img { height: auto; } img.size-full, img.size-large, .wp-post-image, .post-thumbnail img { height: auto; max-width: 100%; } /* Make sure embeds and iframes fit their containers */ embed, iframe, object, video { margin-bottom: 24px; max-width: 100%; } p > embed, p > iframe, p > object, span > embed, span > iframe, span > object { margin-bottom: 0; } /* Alignment */ .alignleft { float: left; } .alignright { float: right; } .aligncenter { display: block; margin-left: auto; margin-right: auto; } blockquote.alignleft, figure.wp-caption.alignleft, img.alignleft { margin: 7px 24px 7px 0; } .wp-caption.alignleft { margin: 7px 14px 7px 0; } blockquote.alignright, figure.wp-caption.alignright, img.alignright { margin: 7px 0 7px 24px; } .wp-caption.alignright { margin: 7px 0 7px 14px; } blockquote.aligncenter, img.aligncenter, .wp-caption.aligncenter { margin-top: 7px; margin-bottom: 7px; } .site-content blockquote.alignleft, .site-content blockquote.alignright { border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(0, 0, 0, 0.1); padding-top: 17px; width: 50%; } .site-content blockquote.alignleft p, .site-content blockquote.alignright p { margin-bottom: 17px; } .wp-caption { margin-bottom: 24px; } .wp-caption img[class*="wp-image-"] { display: block; margin: 0; } .wp-caption { color: #767676; } .wp-caption-text { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-size: 12px; font-style: italic; line-height: 1.5; margin: 9px 0; } div.wp-caption .wp-caption-text { padding-right: 10px; } div.wp-caption.alignright img[class*="wp-image-"], div.wp-caption.alignright .wp-caption-text { padding-left: 10px; padding-right: 0; } .wp-smiley { border: 0; margin-bottom: 0; margin-top: 0; padding: 0; } /* Assistive text */ .screen-reader-text { clip: rect(1px, 1px, 1px, 1px); position: absolute; } .screen-reader-text:focus { background-color: #f1f1f1; border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto; color: #21759b; display: block; font-size: 14px; font-weight: bold; height: auto; line-height: normal; padding: 15px 23px 14px; position: absolute; left: 5px; top: 5px; text-decoration: none; text-transform: none; width: auto; z-index: 100000; /* Above WP toolbar */ } .hide { display: none; } /* Clearing floats */ .footer-sidebar:before, .footer-sidebar:after, .hentry:before, .hentry:after, .gallery:before, .gallery:after, .slider-direction-nav:before, .slider-direction-nav:after, .contributor-info:before, .contributor-info:after, .search-box:before, .search-box:after, [class*="content"]:before, [class*="content"]:after, [class*="site"]:before, [class*="site"]:after { content: ""; display: table; } .footer-sidebar:after, .hentry:after, .gallery:after, .slider-direction-nav:after, .contributor-info:after, .search-box:after, [class*="content"]:after, [class*="site"]:after { clear: both; } /* Genericons */ .bypostauthor > article .fn:before, .comment-edit-link:before, .comment-reply-link:before, .comment-reply-login:before, .comment-reply-title small a:before, .contributor-posts-link:before, .menu-toggle:before, .search-toggle:before, .slider-direction-nav a:before, .widget_twentyfourteen_ephemera .widget-title:before { -webkit-font-smoothing: antialiased; display: inline-block; font: normal 16px/1 Genericons; text-decoration: inherit; vertical-align: text-bottom; } /* Separators */ .site-content span + .entry-date:before, .full-size-link:before, .parent-post-link:before, span + .byline:before, span + .comments-link:before, span + .edit-link:before, .widget_twentyfourteen_ephemera .entry-title:after { content: "\0020\007c\0020"; } /** * 3.0 Basic Structure * ----------------------------------------------------------------------------- */ .site { background-color: #fff; max-width: 1260px; position: relative; } .main-content { width: 100%; } /** * 4.0 Header * ----------------------------------------------------------------------------- */ /* Ensure that there is no gap between the header and the admin bar for WordPress versions before 3.8. */ #wpadminbar { min-height: 32px; } #site-header { position: relative; z-index: 3; } .site-header { background-color: #000; max-width: 1260px; position: relative; width: 100%; z-index: 4; } .header-main { min-height: 48px; padding: 0 10px; } .site-title { float: left; font-size: 18px; font-weight: 700; line-height: 48px; margin: 0; } .site-title a, .site-title a:hover { color: #fff; } /* Search in the header */ .search-toggle { background-color: #24890d; cursor: pointer; float: right; height: 48px; margin-right: 38px; text-align: center; width: 48px; } .search-toggle:hover, .search-toggle.active { background-color: #41a62a; } .search-toggle:before { color: #fff; content: "\f400"; font-size: 20px; margin-top: 14px; } .search-toggle .screen-reader-text { left: 5px; /* Avoid a horizontal scrollbar when the site has a long menu */ } .search-box-wrapper { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: absolute; top: 48px; right: 0; width: 100%; z-index: 2; } .search-box { background-color: #41a62a; padding: 12px; } .search-box .search-field { background-color: #fff; border: 0; float: right; font-size: 16px; padding: 2px 2px 3px 6px; width: 100%; } /** * 5.0 Navigation * ----------------------------------------------------------------------------- */ .site-navigation ul { list-style: none; margin: 0; } .site-navigation li { border-top: 1px solid rgba(255, 255, 255, 0.2); } .site-navigation ul ul { margin-left: 20px; } .site-navigation a { color: #fff; display: block; text-transform: uppercase; } .site-navigation a:hover { color: #41a62a; } .site-navigation .current_page_item > a, .site-navigation .current_page_ancestor > a, .site-navigation .current-menu-item > a, .site-navigation .current-menu-ancestor > a { color: #55d737; font-weight: 900; } /* Primary Navigation */ .primary-navigation { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-size: 14px; padding-top: 24px; } .primary-navigation.toggled-on { padding: 72px 0 36px; } .primary-navigation .nav-menu { border-bottom: 1px solid rgba(255, 255, 255, 0.2); display: none; } .primary-navigation.toggled-on .nav-menu { display: block; } .primary-navigation a { padding: 7px 0; } /* Secondary Navigation */ .secondary-navigation { border-bottom: 1px solid rgba(255, 255, 255, 0.2); font-size: 12px; margin: 48px 0; } .secondary-navigation a { padding: 9px 0; } .menu-toggle { background-color: #000; border-radius: 0; cursor: pointer; font-size: 0; height: 48px; margin: 0; overflow: hidden; padding: 0; position: absolute; top: 0; right: 0; text-align: center; width: 48px; } .menu-toggle:before { color: #fff; content: "\f419"; display: inline; margin-top: 16px; } .menu-toggle:active, .menu-toggle:focus, .menu-toggle:hover { background-color: #444; } .menu-toggle:focus { outline: 1px dotted; } /** * 6.0 Content * ----------------------------------------------------------------------------- */ .content-area { padding-top: 48px; } .hentry { margin: 0 auto 48px; max-width: 672px; } .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content .entry-meta, .page-content { margin: 0 auto; max-width: 474px; } .page-content { margin-bottom: 48px; } /** * 6.1 Post Thumbnail * ----------------------------------------------------------------------------- */ .post-thumbnail { background: #b2b2b2 url(images/pattern-light.svg) repeat fixed; display: block; position: relative; width: 100%; z-index: 0; } a.post-thumbnail:hover { background-color: #999; } .full-width .post-thumbnail img { display: block; margin: 0 auto; } /** * 6.2 Entry Header * ----------------------------------------------------------------------------- */ .entry-header { position: relative; z-index: 1; } .entry-title { font-size: 33px; font-weight: 300; line-height: 1.0909090909; margin-bottom: 12px; margin: 0 0 12px 0; text-transform: uppercase; } .entry-title a { color: #2b2b2b; } .entry-title a:hover { color: #41a62a; } .site-content .entry-header { background-color: #fff; padding: 0 10px 12px; } .site-content .has-post-thumbnail .entry-header { padding-top: 24px; } /** * 6.3 Entry Meta * ----------------------------------------------------------------------------- */ .entry-meta { clear: both; color: #767676; font-size: 12px; font-weight: 400; line-height: 1.3333333333; text-transform: uppercase; } .entry-meta a { color: #767676; } .entry-meta a:hover { color: #41a62a; } .sticky .entry-date { display: none; } .cat-links { font-weight: 900; text-transform: uppercase; } .cat-links a { color: #2b2b2b; } .cat-links a:hover { color: #41a62a; } .byline { display: none; } .single .byline, .group-blog .byline { display: inline; } .site-content .entry-meta { background-color: #fff; margin-bottom: 8px; } .site-content footer.entry-meta { margin: 24px auto 0; padding: 0 10px; } /* Tag links style */ .entry-meta .tag-links a { background-color: #767676; border-radius: 0 2px 2px 0; color: #fff; display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.2727272727; margin: 2px 4px 2px 10px; padding: 3px 7px; position: relative; text-transform: uppercase; } .entry-meta .tag-links a:hover { background-color: #41a62a; color: #fff; } .entry-meta .tag-links a:before { border-top: 10px solid transparent; border-right: 8px solid #767676; border-bottom: 10px solid transparent; content: ""; height: 0; position: absolute; top: 0; left: -8px; width: 0; } .entry-meta .tag-links a:hover:before { border-right-color: #41a62a; } .entry-meta .tag-links a:after { background-color: #fff; border-radius: 50%; content: ""; height: 4px; position: absolute; top: 8px; left: -2px; width: 4px; } /** * 6.4 Entry Content * ----------------------------------------------------------------------------- */ .entry-content, .entry-summary, .page-content { -webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; hyphens: auto; word-wrap: break-word; } .site-content .entry-content, .site-content .entry-summary, .page-content { background-color: #fff; padding: 12px 10px 0; } .page .entry-content { padding-top: 0; } .entry-content h1:first-child, .entry-content h2:first-child, .entry-content h3:first-child, .entry-content h4:first-child, .entry-content h5:first-child, .entry-content h6:first-child, .entry-summary h1:first-child, .entry-summary h2:first-child, .entry-summary h3:first-child, .entry-summary h4:first-child, .entry-summary h5:first-child, .entry-summary h6:first-child, .page-content h1:first-child, .page-content h2:first-child, .page-content h3:first-child, .page-content h4:first-child, .page-content h5:first-child, .page-content h6:first-child { margin-top: 0; } .entry-content a, .entry-summary a, .page-content a, .comment-content a { text-decoration: underline; } .entry-content a:hover, .entry-summary a:hover, .page-content a:hover, .comment-content a:hover, .entry-content a.button, .entry-summary a.button, .page-content a.button, .comment-content a.button { text-decoration: none; } .entry-content table, .comment-content table { font-size: 14px; line-height: 1.2857142857; margin-bottom: 24px; } .entry-content th, .comment-content th { font-weight: 700; padding: 8px; text-transform: uppercase; } .entry-content td, .comment-content td { padding: 8px; } .entry-content .edit-link { clear: both; display: block; font-size: 12px; font-weight: 400; line-height: 1.3333333333; text-transform: uppercase; } .entry-content .edit-link a { color: #767676; text-decoration: none; } .entry-content .edit-link a:hover { color: #41a62a; } /* Mediaelements */ .hentry .mejs-container { margin: 12px 0 18px; } .hentry .mejs-mediaelement, .hentry .mejs-container .mejs-controls { background: #000; } .hentry .mejs-controls .mejs-time-rail .mejs-time-loaded, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { background: #fff; } .hentry .mejs-controls .mejs-time-rail .mejs-time-current { background: #24890d; } .hentry .mejs-controls .mejs-time-rail .mejs-time-total, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { background: rgba(255, 255, 255, .33); } .hentry .mejs-container .mejs-controls .mejs-time { padding-top: 9px; } .hentry .mejs-controls .mejs-time-rail span, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total, .hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { border-radius: 0; } .hentry .mejs-overlay-loading { background: transparent; } /* Page links */ .page-links { clear: both; font-size: 12px; font-weight: 900; line-height: 2; margin: 24px 0; text-transform: uppercase; } .page-links a, .page-links > span { background: #fff; border: 1px solid #fff; display: inline-block; height: 22px; margin: 0 1px 2px 0; text-align: center; width: 22px; } .page-links a { background: #000; border: 1px solid #000; color: #fff; text-decoration: none; } .page-links a:hover { background: #41a62a; border: 1px solid #41a62a; color: #fff; } .page-links > .page-links-title { height: auto; margin: 0; padding-right: 7px; width: auto; } /** * 6.5 Gallery * ----------------------------------------------------------------------------- */ .gallery { margin-bottom: 20px; } .gallery-item { float: left; margin: 0 4px 4px 0; overflow: hidden; position: relative; } .gallery-columns-1 .gallery-item { max-width: 100%; } .gallery-columns-2 .gallery-item { max-width: 48%; max-width: -webkit-calc(50% - 4px); max-width: calc(50% - 4px); } .gallery-columns-3 .gallery-item { max-width: 32%; max-width: -webkit-calc(33.3% - 4px); max-width: calc(33.3% - 4px); } .gallery-columns-4 .gallery-item { max-width: 23%; max-width: -webkit-calc(25% - 4px); max-width: calc(25% - 4px); } .gallery-columns-5 .gallery-item { max-width: 19%; max-width: -webkit-calc(20% - 4px); max-width: calc(20% - 4px); } .gallery-columns-6 .gallery-item { max-width: 15%; max-width: -webkit-calc(16.7% - 4px); max-width: calc(16.7% - 4px); } .gallery-columns-7 .gallery-item { max-width: 13%; max-width: -webkit-calc(14.28% - 4px); max-width: calc(14.28% - 4px); } .gallery-columns-8 .gallery-item { max-width: 11%; max-width: -webkit-calc(12.5% - 4px); max-width: calc(12.5% - 4px); } .gallery-columns-9 .gallery-item { max-width: 9%; max-width: -webkit-calc(11.1% - 4px); max-width: calc(11.1% - 4px); } .gallery-columns-1 .gallery-item:nth-of-type(1n), .gallery-columns-2 .gallery-item:nth-of-type(2n), .gallery-columns-3 .gallery-item:nth-of-type(3n), .gallery-columns-4 .gallery-item:nth-of-type(4n), .gallery-columns-5 .gallery-item:nth-of-type(5n), .gallery-columns-6 .gallery-item:nth-of-type(6n), .gallery-columns-7 .gallery-item:nth-of-type(7n), .gallery-columns-8 .gallery-item:nth-of-type(8n), .gallery-columns-9 .gallery-item:nth-of-type(9n) { margin-right: 0; } .gallery-columns-1.gallery-size-medium figure.gallery-item:nth-of-type(1n+1), .gallery-columns-1.gallery-size-thumbnail figure.gallery-item:nth-of-type(1n+1), .gallery-columns-2.gallery-size-thumbnail figure.gallery-item:nth-of-type(2n+1), .gallery-columns-3.gallery-size-thumbnail figure.gallery-item:nth-of-type(3n+1) { clear: left; } .gallery-caption { background-color: rgba(0, 0, 0, 0.7); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; color: #fff; font-size: 12px; line-height: 1.5; margin: 0; max-height: 50%; opacity: 0; padding: 6px 8px; position: absolute; bottom: 0; left: 0; text-align: left; width: 100%; } .gallery-caption:before { content: ""; height: 100%; min-height: 49px; position: absolute; top: 0; left: 0; width: 100%; } .gallery-item:hover .gallery-caption { opacity: 1; } .gallery-columns-7 .gallery-caption, .gallery-columns-8 .gallery-caption, .gallery-columns-9 .gallery-caption { display: none; } /** * 6.6 Post Formats * ----------------------------------------------------------------------------- */ .format-aside .entry-content, .format-aside .entry-summary, .format-quote .entry-content, .format-quote .entry-summary, .format-link .entry-content, .format-link .entry-summary { padding-top: 0; } .site-content .format-link .entry-title, .site-content .format-aside .entry-title, .site-content .format-quote .entry-title { display: none; } /** * 6.7 Post/Image/Paging Navigation * ----------------------------------------------------------------------------- */ .nav-links { -webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; border-top: 1px solid rgba(0, 0, 0, 0.1); hyphens: auto; word-wrap: break-word; } .post-navigation, .image-navigation { margin: 24px auto 48px; max-width: 474px; padding: 0 10px; } .post-navigation a, .image-navigation .previous-image, .image-navigation .next-image { border-bottom: 1px solid rgba(0, 0, 0, 0.1); padding: 11px 0 12px; width: 100%; } .post-navigation .meta-nav { color: #767676; display: block; font-size: 12px; font-weight: 900; line-height: 2; text-transform: uppercase; } .post-navigation a, .image-navigation a { color: #2b2b2b; display: block; font-size: 14px; font-weight: 700; line-height: 1.7142857142; text-transform: none; } .post-navigation a:hover, .image-navigation a:hover { color: #41a62a; } /* Paging Navigation */ .paging-navigation { border-top: 5px solid #000; margin: 48px 0; } .paging-navigation .loop-pagination { margin-top: -5px; text-align: center; } .paging-navigation .page-numbers { border-top: 5px solid transparent; display: inline-block; font-size: 14px; font-weight: 900; margin-right: 1px; padding: 7px 16px; text-transform: uppercase; } .paging-navigation a { color: #2b2b2b; } .paging-navigation .page-numbers.current { border-top: 5px solid #24890d; } .paging-navigation a:hover { border-top: 5px solid #41a62a; color: #2b2b2b; } /** * 6.8 Attachments * ----------------------------------------------------------------------------- */ .attachment .content-sidebar, .attachment .post-thumbnail { display: none; } .attachment .entry-content { padding-top: 0; } .attachment footer.entry-meta { text-transform: none; } .entry-attachment .attachment { margin-bottom: 24px; } /** * 6.9 Archives * ----------------------------------------------------------------------------- */ .archive-header, .page-header { margin: 24px auto; max-width: 474px; } .archive-title, .page-title { font-size: 16px; font-weight: 900; line-height: 1.5; margin: 0; } .taxonomy-description, .author-description { color: #767676; font-size: 14px; line-height: 1.2857142857; padding-top: 18px; } .taxonomy-description p, .author-description p { margin-bottom: 18px; } .taxonomy-description p:last-child, .author-description p:last-child { margin-bottom: 0; } .taxonomy-description a, .author-description a { text-decoration: underline; } .taxonomy-description a:hover, .author-description a:hover { text-decoration: none; } /** * 6.10 Contributor Page * ----------------------------------------------------------------------------- */ .contributor { border-bottom: 1px solid rgba(0, 0, 0, 0.1); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 48px 10px; } .contributor:first-of-type { padding-top: 24px; } .contributor-info { margin: 0 auto; max-width: 474px; } .contributor-avatar { border: 1px solid rgba(0, 0, 0, 0.1); float: left; margin: 0 30px 20px 0; padding: 2px; } .contributor-name { font-size: 16px; font-weight: 900; line-height: 1.5; margin: 0; } .contributor-bio a { text-decoration: underline; } .contributor-bio a:hover { text-decoration: none; } .contributor-posts-link { display: inline-block; line-height: normal; padding: 10px 30px; } .contributor-posts-link:before { content: "\f443"; } /** * 6.11 404 Page * ----------------------------------------------------------------------------- */ .error404 .page-content { padding-top: 0; } .error404 .page-content .search-form { margin-bottom: 24px; } /** * 6.12 Full-width * ----------------------------------------------------------------------------- */ .full-width .hentry { max-width: 100%; } /** * 6.13 Singular * ----------------------------------------------------------------------------- */ .singular .site-content .hentry.has-post-thumbnail { margin-top: -48px; } /** * 6.14 Comments * ----------------------------------------------------------------------------- */ .comments-area { margin: 48px auto; max-width: 474px; padding: 0 10px; } .comment-reply-title, .comments-title { font: 900 16px/1.5 Lato, sans-serif; margin: 0; text-transform: uppercase; } .comment-list { list-style: none; margin: 0 0 48px 0; } .comment-author { font-size: 14px; line-height: 1.7142857142; } .comment-list .reply, .comment-metadata { font-size: 12px; line-height: 2; text-transform: uppercase; } .comment-list .reply { margin-top: 24px; } .comment-author .fn { font-weight: 900; } .comment-author a { color: #2b2b2b; } .comment-list .trackback a, .comment-list .pingback a, .comment-metadata a { color: #767676; } .comment-author a:hover, .comment-list .pingback a:hover, .comment-list .trackback a:hover, .comment-metadata a:hover { color: #41a62a; } .comment-list article, .comment-list .pingback, .comment-list .trackback { border-top: 1px solid rgba(0, 0, 0, 0.1); margin-bottom: 24px; padding-top: 24px; } .comment-list > li:first-child > article, .comment-list > .pingback:first-child, .comment-list > .trackback:first-child { border-top: 0; } .comment-author { position: relative; } .comment-author .avatar { border: 1px solid rgba(0, 0, 0, 0.1); height: 18px; padding: 2px; position: absolute; top: 0; left: 0; width: 18px; } .bypostauthor > article .fn:before { content: "\f408"; margin: 0 2px 0 -2px; position: relative; top: -1px; } .says { display: none; } .comment-author, .comment-awaiting-moderation, .comment-content, .comment-list .reply, .comment-metadata { padding-left: 30px; } .comment-edit-link { margin-left: 10px; } .comment-edit-link:before { content: "\f411"; } .comment-reply-link:before, .comment-reply-login:before { content: "\f412"; margin-right: 2px; } .comment-content { -webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; hyphens: auto; word-wrap: break-word; } .comment-content ul, .comment-content ol { margin: 0 0 24px 22px; } .comment-content li > ul, .comment-content li > ol { margin-bottom: 0; } .comment-content > :last-child { margin-bottom: 0; } .comment-list .children { list-style: none; margin-left: 15px; } .comment-respond { margin-bottom: 24px; padding: 0; } .comment .comment-respond { margin-top: 24px; } .comment-respond h3 { margin-top: 0; margin-bottom: 24px; } .comment-notes, .comment-awaiting-moderation, .logged-in-as, .no-comments, .form-allowed-tags, .form-allowed-tags code { color: #767676; } .comment-notes, .comment-awaiting-moderation, .logged-in-as { font-size: 14px; line-height: 1.7142857142; } .no-comments { font-size: 16px; font-weight: 900; line-height: 1.5; margin-top: 24px; text-transform: uppercase; } .comment-form label { display: block; } .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"] { width: 100%; } .form-allowed-tags, .form-allowed-tags code { font-size: 12px; line-height: 1.5; } .required { color: #c0392b; } .comment-reply-title small a { color: #2b2b2b; float: right; height: 24px; overflow: hidden; width: 24px; } .comment-reply-title small a:hover { color: #41a62a; } .comment-reply-title small a:before { content: "\f405"; font-size: 32px; } .comment-navigation { font-size: 12px; line-height: 2; margin-bottom: 48px; text-transform: uppercase; } .comment-navigation .nav-next, .comment-navigation .nav-previous { display: inline-block; } .comment-navigation .nav-previous a { margin-right: 10px; } #comment-nav-above { margin-top: 36px; margin-bottom: 0; } /** * 7.0 Sidebars * ----------------------------------------------------------------------------- */ /* Secondary */ #secondary { background-color: #000; border-top: 1px solid #000; border-bottom: 1px solid rgba(255, 255, 255, 0.2); clear: both; color: rgba(255, 255, 255, 0.7); margin-top: -1px; padding: 0 10px; position: relative; z-index: 2; } .site-description { display: none; font-size: 12px; font-weight: 400; line-height: 1.5; } /* Primary Sidebar */ .primary-sidebar { padding-top: 48px; } .secondary-navigation + .primary-sidebar { padding-top: 0; } /* Content Sidebar */ .content-sidebar { border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(0, 0, 0, 0.1); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; color: #767676; padding: 48px 10px 0; } /** * 7.1 Widgets * ----------------------------------------------------------------------------- */ /* Primary Sidebar, Footer Sidebar */ .widget { font-size: 14px; -webkit-hyphens: auto; -moz-hyphens: auto; -ms-hyphens: auto; hyphens: auto; line-height: 1.2857142857; margin-bottom: 48px; width: 100%; word-wrap: break-word; } .widget a { color: #fff; } .widget a:hover { color: #41a62a; } .widget h1, .widget h2, .widget h3, .widget h4, .widget h5, .widget h6 { margin: 24px 0 12px; } .widget h1 { font-size: 22px; line-height: 1.0909090909; } .widget h2 { font-size: 20px; line-height: 1.2; } .widget h3 { font-size: 18px; line-height: 1.3333333333; } .widget h4 { font-size: 16px; line-height: 1.5; } .widget h5 { font-size: 14px; line-height: 1.7142857142; } .widget h6 { font-size: 12px; line-height: 2; } .widget address { margin-bottom: 18px; } .widget abbr[title] { border-color: rgba(255, 255, 255, 0.7); } .widget mark, .widget ins { color: #000; } .widget pre, .widget fieldset { border-color: rgba(255, 255, 255, 0.2); } .widget code, .widget kbd, .widget tt, .widget var, .widget samp, .widget pre { font-size: 12px; line-height: 1.5; } .widget blockquote { color: rgba(255, 255, 255, 0.7); font-size: 18px; line-height: 1.5; margin-bottom: 18px; } .widget blockquote cite { color: #fff; font-size: 14px; line-height: 1.2857142857; } .widget dl, .widget dd { margin-bottom: 18px; } .widget ul, .widget ol { list-style: none; margin: 0; } .widget li > ol, .widget li > ul { margin-left: 10px; } .widget table, .widget th, .widget td { border-color: rgba(255, 255, 255, 0.2); } .widget table { margin-bottom: 18px; } .widget del { color: rgba(255, 255, 255, 0.4); } .widget hr { background-color: rgba(255, 255, 255, 0.2); } .widget p { margin-bottom: 18px; } .widget input, .widget textarea { background-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #fff; font-size: 16px; padding: 1px 2px 2px 4px; } .widget input:focus, .widget textarea:focus { border-color: rgba(255, 255, 255, 0.3); } .widget button, .widget .button, .widget input[type="button"], .widget input[type="reset"], .widget input[type="submit"] { background-color: #24890d; border: 0; font-size: 12px; padding: 5px 15px 4px; } .widget input[type="button"]:hover, .widget input[type="button"]:focus, .widget input[type="reset"]:hover, .widget input[type="reset"]:focus, .widget input[type="submit"]:hover, .widget input[type="submit"]:focus { background-color: #41a62a; } .widget input[type="button"]:active, .widget input[type="reset"]:active, .widget input[type="submit"]:active { background-color: #55d737; } .widget .wp-caption { color: rgba(255, 255, 255, 0.7); margin-bottom: 18px; } .widget .widget-title { font-size: 14px; font-weight: 700; line-height: 1.7142857142; margin: 0 0 24px 0; text-transform: uppercase; } .widget-title, .widget-title a { color: #fff; } .widget-title a:hover { color: #41a62a; } /* Calendar Widget*/ .widget_calendar table { line-height: 2; margin: 0; } .widget_calendar caption { color: #fff; font-weight: 700; line-height: 1.7142857142; margin-bottom: 18px; text-align: left; text-transform: uppercase; } .widget_calendar thead th { background-color: rgba(255, 255, 255, 0.1); } .widget_calendar tbody td, .widget_calendar thead th { text-align: center; } .widget_calendar tbody a { background-color: #24890d; color: #fff; display: block; } .widget_calendar tbody a:hover { background-color: #41a62a; } .widget_calendar tbody a:hover { color: #fff; } .widget_calendar #prev { padding-left: 5px; } .widget_calendar #next { padding-right: 5px; text-align: right; } /* Ephemera Widget*/ .widget_twentyfourteen_ephemera > ol > li { border-bottom: 1px solid rgba(255, 255, 255, 0.2); margin-bottom: 18px; padding: 0; } .widget_twentyfourteen_ephemera .hentry { margin: 0; max-width: 100%; } .widget_twentyfourteen_ephemera .entry-title, .widget_twentyfourteen_ephemera .entry-meta, .widget_twentyfourteen_ephemera .wp-caption-text, .widget_twentyfourteen_ephemera .post-format-archive-link, .widget_twentyfourteen_ephemera .entry-content table { font-size: 12px; line-height: 1.5; } .widget_twentyfourteen_ephemera .entry-title { display: inline; font-weight: 400; } .widget_twentyfourteen_ephemera .entry-meta { margin-bottom: 18px; } .widget_twentyfourteen_ephemera .entry-meta a { color: rgba(255, 255, 255, 0.7); } .widget_twentyfourteen_ephemera .entry-meta a:hover { color: #41a62a; } .widget_twentyfourteen_ephemera .entry-content ul, .widget_twentyfourteen_ephemera .entry-content ol { margin: 0 0 18px 20px; } .widget_twentyfourteen_ephemera .entry-content ul { list-style: disc; } .widget_twentyfourteen_ephemera .entry-content ol { list-style: decimal; } .widget_twentyfourteen_ephemera .entry-content li > ul, .widget_twentyfourteen_ephemera .entry-content li > ol { margin: 0 0 0 20px; } .widget_twentyfourteen_ephemera .entry-content th, .widget_twentyfourteen_ephemera .entry-content td { padding: 6px; } .widget_twentyfourteen_ephemera .post-format-archive-link { font-weight: 700; text-transform: uppercase; } /* List Style Widgets*/ .widget_archive li, .widget_categories li, .widget_links li, .widget_meta li, .widget_nav_menu li, .widget_pages li, .widget_recent_comments li, .widget_recent_entries li { border-top: 1px solid rgba(255, 255, 255, 0.2); padding: 8px 0 9px; } .widget_archive li:first-child, .widget_categories li:first-child, .widget_links li:first-child, .widget_meta li:first-child, .widget_nav_menu li:first-child, .widget_pages li:first-child, .widget_recent_comments li:first-child, .widget_recent_entries li:first-child { border-top: 0; } .widget_categories li ul, .widget_nav_menu li ul, .widget_pages li ul { border-top: 1px solid rgba(255, 255, 255, 0.2); margin-top: 9px; } .widget_categories li li:last-child, .widget_nav_menu li li:last-child, .widget_pages li li:last-child { padding-bottom: 0; } /* Recent Posts Widget */ .widget_recent_entries .post-date { display: block; } /* RSS Widget */ .rsswidget img { margin-top: -4px; } .rssSummary { margin: 9px 0; } .rss-date { display: block; } .widget_rss li { margin-bottom: 18px; } .widget_rss li:last-child { margin-bottom: 0; } /* Text Widget */ .widget_text > div > :last-child { margin-bottom: 0; } /** * 7.2 Content Sidebar Widgets * ----------------------------------------------------------------------------- */ .content-sidebar .widget a { color: #24890d; } .content-sidebar .widget a:hover { color: #41a62a; } .content-sidebar .widget pre { border-color: rgba(0, 0, 0, 0.1); } .content-sidebar .widget mark, .content-sidebar .widget ins { color: #2b2b2b; } .content-sidebar .widget abbr[title] { border-color: #2b2b2b; } .content-sidebar .widget fieldset { border-color: rgba(0, 0, 0, 0.1); } .content-sidebar .widget blockquote { color: #767676; } .content-sidebar .widget blockquote cite { color: #2b2b2b; } .content-sidebar .widget li > ol, .content-sidebar .widget li > ul { margin-left: 18px; } .content-sidebar .widget table, .content-sidebar .widget th, .content-sidebar .widget td { border-color: rgba(0, 0, 0, 0.1); } .content-sidebar .widget del { color: #767676; } .content-sidebar .widget hr { background-color: rgba(0, 0, 0, 0.1); } .content-sidebar .widget input, .content-sidebar .widget textarea { background-color: #fff; border-color: rgba(0, 0, 0, 0.1); color: #2b2b2b; } .content-sidebar .widget input:focus, .content-sidebar .widget textarea:focus { border-color: rgba(0, 0, 0, 0.3); } .content-sidebar .widget input[type="button"], .content-sidebar .widget input[type="reset"], .content-sidebar .widget input[type="submit"] { background-color: #24890d; border: 0; color: #fff; } .content-sidebar .widget input[type="button"]:hover, .content-sidebar .widget input[type="button"]:focus, .content-sidebar .widget input[type="reset"]:hover, .content-sidebar .widget input[type="reset"]:focus, .content-sidebar .widget input[type="submit"]:hover, .content-sidebar .widget input[type="submit"]:focus { background-color: #41a62a; } .content-sidebar .widget input[type="button"]:active, .content-sidebar .widget input[type="reset"]:active, .content-sidebar .widget input[type="submit"]:active { background-color: #55d737; } .content-sidebar .widget .wp-caption { color: #767676; } .content-sidebar .widget .widget-title { border-top: 5px solid #000; color: #2b2b2b; font-size: 14px; font-weight: 900; margin: 0 0 18px; padding-top: 7px; text-transform: uppercase; } .content-sidebar .widget .widget-title a { color: #2b2b2b; } .content-sidebar .widget .widget-title a:hover { color: #41a62a; } /* List Style Widgets*/ .content-sidebar .widget_archive li, .content-sidebar .widget_categories li, .content-sidebar .widget_links li, .content-sidebar .widget_meta li, .content-sidebar .widget_nav_menu li, .content-sidebar .widget_pages li, .content-sidebar .widget_recent_comments li, .content-sidebar .widget_recent_entries li, .content-sidebar .widget_categories li ul, .content-sidebar .widget_nav_menu li ul, .content-sidebar .widget_pages li ul { border-color: rgba(0, 0, 0, 0.1); } /* Calendar Widget */ .content-sidebar .widget_calendar caption { color: #2b2b2b; font-weight: 900; } .content-sidebar .widget_calendar thead th { background-color: rgba(0, 0, 0, 0.02); } .content-sidebar .widget_calendar tbody a, .content-sidebar .widget_calendar tbody a:hover { color: #fff; } /* Ephemera widget*/ .content-sidebar .widget_twentyfourteen_ephemera .widget-title { line-height: 1.2857142857; padding-top: 1px; } .content-sidebar .widget_twentyfourteen_ephemera .widget-title:before { background-color: #000; color: #fff; margin: -1px 9px 0 0; padding: 6px 0 9px; text-align: center; vertical-align: middle; width: 36px; } .content-sidebar .widget_twentyfourteen_ephemera .video.widget-title:before { content: "\f104"; } .content-sidebar .widget_twentyfourteen_ephemera .audio.widget-title:before { content: "\f109"; } .content-sidebar .widget_twentyfourteen_ephemera .image.widget-title:before { content: "\f473"; } .content-sidebar .widget_twentyfourteen_ephemera .gallery.widget-title:before { content: "\f103"; } .content-sidebar .widget_twentyfourteen_ephemera .aside.widget-title:before { content: "\f101"; } .content-sidebar .widget_twentyfourteen_ephemera .quote.widget-title:before { content: "\f106"; } .content-sidebar .widget_twentyfourteen_ephemera .link.widget-title:before { content: "\f107"; } .content-sidebar .widget_twentyfourteen_ephemera > ol > li { border-bottom: 1px solid rgba(0, 0, 0, 0.1); } .content-sidebar .widget_twentyfourteen_ephemera .entry-meta { color: #ccc; } .content-sidebar .widget_twentyfourteen_ephemera .entry-meta a { color: #767676; } .content-sidebar .widget_twentyfourteen_ephemera .entry-meta a:hover { color: #41a62a; } .content-sidebar.widget_twentyfourteen_ephemera blockquote cite { font-size: 13px; line-height: 1.3846153846; } .content-sidebar .widget_twentyfourteen_ephemera .post-format-archive-link { font-weight: 900; } /** * 8.0 Footer * ----------------------------------------------------------------------------- */ #supplementary { padding: 0 10px; } .site-footer, .site-info, .site-info a { color: rgba(255, 255, 255, 0.7); } .site-footer { background-color: #000; font-size: 12px; position: relative; z-index: 3; } .footer-sidebar { padding-top: 48px; } .site-info { padding: 15px 10px; } #supplementary + .site-info { border-top: 1px solid rgba(255, 255, 255, 0.2); } .site-info a:hover { color: #41a62a; } /** * 9.0 Featured Content * ----------------------------------------------------------------------------- */ .featured-content { background: #000 url(images/pattern-dark.svg) repeat fixed; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; width: 100%; } .featured-content-inner { overflow: hidden; } .featured-content .hentry { color: #fff; margin: 0; max-width: 100%; width: 100%; } .featured-content .post-thumbnail, .featured-content .post-thumbnail:hover { background: transparent; } .featured-content .post-thumbnail { display: block; position: relative; padding-top: 55.357142857%; overflow: hidden; } .featured-content .post-thumbnail img { left: 0; position: absolute; top: 0; } .featured-content .entry-header { background-color: #000; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; min-height: 96px; overflow: hidden; padding: 24px 10px; } .featured-content a { color: #fff; } .featured-content a:hover { color: #41a62a; } .featured-content .entry-meta { color: #fff; font-size: 11px; font-weight: 700; line-height: 1.0909090909; margin-bottom: 12px; } .featured-content .cat-links { font-weight: 700; } .featured-content .entry-title { font-size: 18px; font-weight: 300; line-height: 1.3333333333; margin: 0; text-transform: uppercase; } /* Slider */ .slider .featured-content .hentry { -webkit-backface-visibility: hidden; display: none; position: relative; } .slider .featured-content .post-thumbnail { padding-top: 55.49132947%; } .slider-control-paging { background-color: #000; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; list-style: none; margin: -24px 0 0 0; position: relative; width: 100%; z-index: 3; } .slider-control-paging li { float: left; margin: 2px 4px 2px 0; } .slider-control-paging li:last-child { margin-right: 0; } .slider-control-paging a { cursor: pointer; display: block; height: 44px; position: relative; text-indent: -999em; width: 44px; } .slider-control-paging a:before { background-color: #4d4d4d; content: ""; height: 12px; left: 10px; position: absolute; top: 16px; width: 12px; } .slider-control-paging a:hover:before { background-color: #41a62a; } .slider-control-paging .slider-active:before, .slider-control-paging .slider-active:hover:before { background-color: #24890d; } .slider-direction-nav { clear: both; list-style: none; margin: 0; position: relative; width: 100%; z-index: 3; } .slider-direction-nav li { border-color: #fff; border-style: solid; border-width: 2px 1px 0 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; text-align: center; width: 50%; } .slider-direction-nav li:last-child { border-width: 2px 0 0 1px; } .slider-direction-nav a { background-color: #000; display: block; font-size: 0; height: 46px; } .slider-direction-nav a:hover { background-color: #24890d; } .slider-direction-nav a:before { color: #fff; content: "\f430"; font-size: 32px; line-height: 46px; } .slider-direction-nav .slider-next:before { content: "\f429"; } .slider-direction-nav .slider-disabled { display: none; } /** * 10.0 Multisite * ----------------------------------------------------------------------------- */ .site-main .widecolumn { padding-top: 72px; width: auto; } .site-main .mu_register, .widecolumn > h2, .widecolumn > form { margin: 0 auto 48px; max-width: 474px; padding: 0 30px; } .site-main .mu_register #blog_title, .site-main .mu_register #user_email, .site-main .mu_register #blogname, .site-main .mu_register #user_name { font-size: inherit; width: 90%; } .site-main .mu_register input[type="submit"], .widecolumn #submit { font-size: inherit; width: auto; } /** * 11.0 Media Queries * ----------------------------------------------------------------------------- */ /* Does the same thing as <meta name="viewport" content="width=device-width">, * but in the future W3C standard way. -ms- prefix is required for IE10+ to * render responsive styling in Windows 8 "snapped" views; IE10+ does not honor * the meta tag. See http://core.trac.wordpress.org/ticket/25888. */ @-ms-viewport { width: device-width; } @viewport { width: device-width; } @media screen and (max-width: 400px) { .list-view .site-content .post-thumbnail { background: none; width: auto; z-index: 2; } .list-view .site-content .post-thumbnail img { float: left; margin: 0 10px 3px 0; width: 84px; } .list-view .site-content .entry-header { background-color: transparent; padding: 0; } .list-view .content-area { padding: 0 10px; } .list-view .site-content .hentry { border-bottom: 1px solid rgba(0, 0, 0, 0.1); margin: 0; min-height: 60px; padding: 12px 0 9px; } .list-view .site-content .cat-links, .list-view .site-content .type-post .entry-content, .list-view .site-content .type-page .entry-content, .list-view .site-content .type-post .entry-summary, .list-view .site-content .type-page .entry-summary, .list-view .site-content footer.entry-meta { display: none; } .list-view .site-content .entry-title { clear: none; font-size: 15px; font-weight: 900; line-height: 1.2; margin-bottom: 6px; text-transform: none; } .list-view .site-content .format-aside .entry-title, .list-view .site-content .format-link .entry-title, .list-view .site-content .format-quote .entry-title { display: block; } .list-view .site-content .entry-meta { background-color: transparent; clear: none; margin: 0; text-transform: none; } .archive-header, .page-header { border-bottom: 1px solid rgba(0, 0, 0, 0.1); margin: 24px auto 0; padding-bottom: 24px; } .error404 .page-header { border-bottom: 0; margin: 0 auto 24px; padding: 0 10px; } } @media screen and (min-width: 401px) { a.post-thumbnail:hover img { opacity: 0.85; } .full-size-link:before, .parent-post-link:before, .site-content span + .byline:before, .site-content span + .comments-link:before, .site-content span + .edit-link:before, .site-content span + .entry-date:before { content: ""; } .attachment span.entry-date:before, .entry-content .edit-link a:before, .entry-meta .edit-link a:before, .site-content .byline a:before, .site-content .comments-link a:before, .site-content .entry-date a:before, .site-content .featured-post:before, .site-content .full-size-link a:before, .site-content .parent-post-link a:before, .site-content .post-format a:before { -webkit-font-smoothing: antialiased; display: inline-block; font: normal 16px/1 Genericons; text-decoration: inherit; vertical-align: text-bottom; } .site-content .entry-meta > span { margin-right: 10px; } .site-content .format-video .post-format a:before { content: "\f104"; } .site-content .format-audio .post-format a:before { content: "\f109"; } .site-content .format-image .post-format a:before { content: "\f473"; } .site-content .format-quote .post-format a:before { content: "\f106"; margin-right: 2px; } .site-content .format-gallery .post-format a:before { content: "\f103"; margin-right: 4px; } .site-content .format-aside .post-format a:before { content: "\f101"; margin-right: 2px; } .site-content .format-link .post-format a:before { content: "\f107"; position: relative; top: 1px; } .site-content .featured-post:before { content: "\f308"; margin-right: 3px; position: relative; top: 1px; } .site-content .entry-date a:before, .attachment .site-content span.entry-date:before { content: "\f303"; margin-right: 1px; position: relative; top: 1px; } .site-content .byline a:before { content: "\f304"; } .site-content .comments-link a:before { content: "\f300"; margin-right: 2px; } .entry-content .edit-link a:before, .entry-meta .edit-link a:before { content: "\f411"; } .site-content .full-size-link a:before { content: "\f402"; margin-right: 1px; } .site-content .parent-post-link a:before { content: "\f301"; } .list-view .site-content .hentry { border-top: 1px solid rgba(0, 0, 0, 0.1); padding-top: 48px; } .list-view .site-content .hentry:first-of-type, .list-view .site-content .hentry.has-post-thumbnail { border-top: 0; padding-top: 0; } .archive-header, .page-header { margin: 0 auto 60px; padding: 0 10px; } .error404 .page-header { margin-bottom: 24px; } } @media screen and (min-width: 594px) { .site-content .entry-header { padding-right: 30px; padding-left: 30px; } .site-content .has-post-thumbnail .entry-header { margin-top: -48px; } } @media screen and (min-width: 673px) { .header-main { padding: 0 30px; } .search-toggle { margin-right: 18px; } .search-box .search-field { width: 50%; } .content-area { float: left; width: 100%; } .site-content { margin-right: 33.33333333%; } .site-content .has-post-thumbnail .entry-header { margin-top: 0; } .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { padding-right: 30px; padding-left: 30px; } .singular .site-content .hentry.has-post-thumbnail { margin-top: 0; } .full-width .site-content { margin-right: 0; } .full-width .site-content .has-post-thumbnail .entry-header, .full-width.singular .site-content .hentry.has-post-thumbnail, .full-width.home .site-content .hentry.has-post-thumbnail { margin-top: -48px; } #secondary, #supplementary { padding: 0 30px; } .content-sidebar { border: 0; float: right; margin-left: -33.33333333%; padding: 48px 30px 24px; position: relative; width: 33.33333333%; } .grid .featured-content .hentry { float: left; width: 50%; } .grid .featured-content .hentry:nth-child( 2n+1 ) { clear: both; } .grid .featured-content .entry-header { border-color: #000; border-style: solid; border-width: 12px 10px; height: 96px; padding: 0; } .slider .featured-content .entry-title { font-size: 22px; line-height: 1.0909090909; } .slider .featured-content .entry-header { min-height: inherit; padding: 24px 30px 48px; position: absolute; left: 0; bottom: 0; width: 50%; z-index: 3; } .slider-control-paging { background: transparent; margin-top: -48px; padding-left: 20px; width: 50%; } .slider-direction-nav { clear: none; float: right; margin-top: -48px; width: 98px; } .slider-direction-nav li { border: 0; padding: 0 1px 0 0; } .slider-direction-nav li:last-child { padding: 0 0 0 1px; } .slider-direction-nav a { height: 48px; } .slider-direction-nav a:before { line-height: 48px; } .site-info { padding: 15px 30px; } } @media screen and (min-width: 783px) { .header-main { padding-right: 0; } .search-toggle { margin-right: 0; } /* Fixed Header */ .masthead-fixed .site-header { position: fixed; top: 0; } .admin-bar.masthead-fixed .site-header { top: 32px; } .masthead-fixed .site-main { margin-top: 48px; } /* Navigation */ .site-navigation li .current_page_item > a, .site-navigation li .current_page_ancestor > a, .site-navigation li .current-menu-item > a, .site-navigation li .current-menu-ancestor > a { color: #fff; } /* Primary Navigation */ .primary-navigation { float: right; font-size: 11px; margin: 0 1px 0 -12px; padding: 0; text-transform: uppercase; } .primary-navigation .menu-toggle { display: none; padding: 0; } .primary-navigation .nav-menu { border-bottom: 0; display: block; } .primary-navigation.toggled-on { border-bottom: 0; margin: 0; padding: 0; } .primary-navigation li { border: 0; display: inline-block; height: 48px; line-height: 48px; position: relative; } .primary-navigation a { display: inline-block; padding: 0 12px; white-space: nowrap; } .primary-navigation ul ul { background-color: #24890d; float: left; margin: 0; position: absolute; top: 48px; left: -999em; z-index: 99999; } .primary-navigation li li { border: 0; display: block; height: auto; line-height: 1.0909090909; } .primary-navigation ul ul ul { left: -999em; top: 0; } .primary-navigation ul ul a { padding: 18px 12px; white-space: normal; width: 176px; } .primary-navigation li:hover > a, .primary-navigation li.focus > a { background-color: #24890d; color: #fff; } .primary-navigation ul ul a:hover, .primary-navigation ul ul li.focus > a { background-color: #41a62a; } .primary-navigation ul li:hover > ul, .primary-navigation ul li.focus > ul { left: auto; } .primary-navigation ul ul li:hover > ul, .primary-navigation ul ul li.focus > ul { left: 100%; } .primary-navigation .menu-item-has-children > a, .primary-navigation .page_item_has_children > a { padding-right: 26px; } .primary-navigation .menu-item-has-children > a:after, .primary-navigation .page_item_has_children > a:after { -webkit-font-smoothing: antialiased; content: "\f502"; display: inline-block; font: normal 8px/1 Genericons; position: absolute; right: 12px; top: 22px; vertical-align: text-bottom; } .primary-navigation li .menu-item-has-children > a, .primary-navigation li .page_item_has_children > a { padding-right: 20px; width: 168px; } .primary-navigation .menu-item-has-children li.menu-item-has-children > a:after, .primary-navigation .menu-item-has-children li.page_item_has_children > a:after, .primary-navigation .page_item_has_children li.menu-item-has-children > a:after, .primary-navigation .page_item_has_children li.page_item_has_children > a:after { content: "\f501"; right: 8px; top: 20px; } } @media screen and (min-width: 810px) { .attachment .entry-attachment .attachment { margin-right: -168px; margin-left: -168px; max-width: 810px; } .attachment .site-content .attachment img { display: block; margin: 0 auto; } .contributor-avatar { margin-left: -168px; } .contributor-summary { float: left; } .full-width .site-content blockquote.alignleft, .full-width .site-content blockquote.alignright { width: -webkit-calc(50% + 130px); width: calc(50% + 130px); } .full-width .site-content blockquote.alignleft, .full-width .site-content img.size-full.alignleft, .full-width .site-content img.size-large.alignleft, .full-width .site-content img.size-medium.alignleft, .full-width .site-content .wp-caption.alignleft { margin-left: -168px; } .full-width .site-content .alignleft { clear: left; } .full-width .site-content blockquote.alignright, .full-width .site-content img.size-full.alignright, .full-width .site-content img.size-large.alignright, .full-width .site-content img.size-medium.alignright, .full-width .site-content .wp-caption.alignright { margin-right: -168px; } .full-width .site-content .alignright { clear: right; } } @media screen and (min-width: 846px) { .content-area, .content-sidebar { padding-top: 72px; } .site-content .has-post-thumbnail .entry-header { margin-top: -48px; } .comment-list .trackback, .comment-list .pingback, .comment-list article { margin-bottom: 36px; padding-top: 36px; } .comment-author .avatar { height: 34px; top: 2px; width: 34px; } .comment-author, .comment-awaiting-moderation, .comment-content, .comment-list .reply, .comment-metadata { padding-left: 50px; } .comment-list .children { margin-left: 20px; } .full-width.singular .site-content .hentry.has-post-thumbnail, .full-width.home .site-content .hentry.has-post-thumbnail { margin-top: -72px; } .featured-content { margin-bottom: 0; } } @media screen and (min-width: 1008px) { .search-box-wrapper { padding-left: 182px; } .main-content { float: left; } .site-content { margin-right: 29.04761904%; margin-left: 182px; } .site-content .entry-header { margin-top: 0; } .site-content .has-post-thumbnail .entry-header { margin-top: 0; } .content-sidebar { margin-left: -29.04761904%; width: 29.04761904%; } .site:before { background-color: #000; content: ""; display: block; height: 100%; min-height: 100%; position: absolute; top: 0; left: 0; width: 182px; z-index: 2; } #secondary { background-color: transparent; border: 0; clear: none; float: left; margin: 0 0 0 -100%; min-height: 100vh; width: 122px; } .primary-sidebar { padding-top: 0; } .site-description { display: block; margin: -3px 0 21px; } .site-description:empty { margin: 0; } .secondary-navigation { font-size: 11px; margin: 0 -30px 48px; width: 182px; } .secondary-navigation li { border-top: 1px solid rgba(255, 255, 255, 0.2); position: relative; } .secondary-navigation a { padding: 10px 30px; } .secondary-navigation ul ul { background-color: #24890d; position: absolute; top: 0; left: -999em; width: 182px; z-index: 99999; } .secondary-navigation li li { border-top: 0; } .secondary-navigation li:hover > a, .secondary-navigation li.focus > a { background-color: #24890d; color: #fff; } .secondary-navigation ul ul a:hover, .secondary-navigation ul ul li.focus > a { background-color: #41a62a; } .secondary-navigation ul li:hover > ul, .secondary-navigation ul li.focus > ul { left: 162px; } .secondary-navigation .menu-item-has-children > a { padding-right: 38px; } .secondary-navigation .menu-item-has-children > a:after { -webkit-font-smoothing: antialiased; content: "\f501"; display: inline-block; font: normal 8px/1 Genericons; position: absolute; right: 26px; top: 14px; vertical-align: text-bottom; } .footer-sidebar .widget, .primary-sidebar .widget { font-size: 12px; line-height: 1.5; } .footer-sidebar .widget { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; padding: 0 30px; width: 25%; } .footer-sidebar .widget h1, .primary-sidebar .widget h1 { font-size: 20px; line-height: 1.2; } .footer-sidebar .widget h2, .primary-sidebar .widget h2 { font-size: 18px; line-height: 1.3333333333; } .footer-sidebar .widget h3, .primary-sidebar .widget h3 { font-size: 16px; line-height: 1.5; } .footer-sidebar .widget h4, .primary-sidebar .widget h4 { font-size: 14px; line-height: 1.7142857142; } .footer-sidebar .widget h5, .primary-sidebar .widget h5 { font-size: 12px; line-height: 2; } .footer-sidebar .widget h6, .primary-sidebar .widget h6 { font-size: 11px; line-height: 2.1818181818; } .footer-sidebar .widget code, .footer-sidebar .widget kbd, .footer-sidebar .widget tt, .footer-sidebar .widget var, .footer-sidebar .widget samp, .footer-sidebar .widget pre, .primary-sidebar .widget code, .primary-sidebar .widget kbd, .primary-sidebar .widget tt, .primary-sidebar .widget var, .primary-sidebar .widget samp, .primary-sidebar .widget pre { font-size: 11px; line-height: 1.6363636363; } .footer-sidebar .widget blockquote, .primary-sidebar .widget blockquote { font-size: 14px; line-height: 1.2857142857; } .footer-sidebar .widget blockquote cite, .primary-sidebar .widget blockquote cite { font-size: 12px; line-height: 1.5; } .footer-sidebar .widget input, .footer-sidebar .widget textarea, .primary-sidebar .widget input, .primary-sidebar .widget textarea { font-size: 12px; padding: 3px 2px 4px 4px; } .footer-sidebar .widget input[type="button"], .footer-sidebar .widget input[type="reset"], .footer-sidebar .widget input[type="submit"], .primary-sidebar .widget input[type="button"], .primary-sidebar .widget input[type="reset"], .primary-sidebar .widget input[type="submit"] { padding: 5px 15px 4px; } .footer-sidebar .widget .widget-title, .primary-sidebar .widget .widget-title { font-size: 11px; font-weight: 900; line-height: 1.6363636363; margin-bottom: 18px; } .footer-sidebar .widget_twentyfourteen_ephemera .entry-title, .footer-sidebar .widget_twentyfourteen_ephemera .entry-meta, .footer-sidebar .widget_twentyfourteen_ephemera .wp-caption-text, .footer-sidebar .widget_twentyfourteen_ephemera .post-format-archive-link, .footer-sidebar .widget_twentyfourteen_ephemera .entry-content table, .primary-sidebar .widget_twentyfourteen_ephemera .entry-title, .primary-sidebar .widget_twentyfourteen_ephemera .entry-meta, .primary-sidebar .widget_twentyfourteen_ephemera .wp-caption-text, .primary-sidebar .widget_twentyfourteen_ephemera .post-format-archive-link, .primary-sidebar .widget_twentyfourteen_ephemera .entry-content table { font-size: 11px; line-height: 1.6363636363; } .footer-sidebar .widget_archive li, .footer-sidebar .widget_categories li, .footer-sidebar .widget_links li, .footer-sidebar .widget_meta li, .footer-sidebar .widget_nav_menu li, .footer-sidebar .widget_pages li, .footer-sidebar .widget_recent_comments li, .footer-sidebar .widget_recent_entries li, .primary-sidebar .widget_archive li, .primary-sidebar .widget_categories li, .primary-sidebar .widget_links li, .primary-sidebar .widget_meta li, .primary-sidebar .widget_nav_menu li, .primary-sidebar .widget_pages li, .primary-sidebar .widget_recent_comments li, .primary-sidebar .widget_recent_entries li { border-top: 0; padding: 0 0 6px; } .footer-sidebar .widget_archive li:last-child, .footer-sidebar .widget_categories li:last-child, .footer-sidebar .widget_links li:last-child, .footer-sidebar .widget_meta li:last-child, .footer-sidebar .widget_nav_menu li:last-child, .footer-sidebar .widget_pages li:last-child, .footer-sidebar .widget_recent_comments li:last-child, .footer-sidebar .widget_recent_entries li:last-child, .primary-sidebar .widget_archive li:last-child, .primary-sidebar .widget_categories li:last-child, .primary-sidebar .widget_links li:last-child, .primary-sidebar .widget_meta li:last-child, .primary-sidebar .widget_nav_menu li:last-child, .primary-sidebar .widget_pages li:last-child, .primary-sidebar .widget_recent_comments li:last-child, .primary-sidebar .widget_recent_entries li:last-child { padding: 0; } .footer-sidebar .widget_categories li ul, .footer-sidebar .widget_nav_menu li ul, .footer-sidebar .widget_pages li ul, .primary-sidebar .widget_categories li ul, .primary-sidebar .widget_nav_menu li ul, .primary-sidebar .widget_pages li ul { border-top: 0; margin-top: 6px; } #supplementary { padding: 0; } .footer-sidebar { font-size: 12px; line-height: 1.5; } .featured-content { padding-left: 182px; } .grid .featured-content .hentry { width: 33.3333333%; } .grid .featured-content .hentry:nth-child( 2n+1 ) { clear: none; } .grid .featured-content .hentry:nth-child( 3n+1 ) { clear: both; } .grid .featured-content .entry-header { height: 120px; } } @media screen and (min-width: 1040px) { .site-content .has-post-thumbnail .entry-header { margin-top: -48px; } .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { padding-right: 15px; padding-left: 15px; } .full-width .archive-header, .full-width .comments-area, .full-width .image-navigation, .full-width .page-header, .full-width .page-content, .full-width .post-navigation, .full-width .site-content .entry-header, .full-width .site-content .entry-content, .full-width .site-content .entry-summary, .full-width .site-content footer.entry-meta { padding-right: 30px; padding-left: 30px; } } @media screen and (min-width: 1080px) { .search-box .search-field { width: 324px; } .site-content, .site-main .widecolumn { margin-left: 222px; } .site:before { width: 222px; } .search-box-wrapper, .featured-content { padding-left: 222px; } #secondary { width: 162px; } .secondary-navigation, .secondary-navigation ul ul { width: 222px; } .secondary-navigation ul li:hover > ul, .secondary-navigation ul li.focus > ul { left: 202px; } .slider .featured-content .entry-title { font-size: 33px; } .slider .featured-content .entry-header, .slider-control-paging { width: 534px; } .slider-control-paging { padding-left: 24px; } .slider-control-paging li { margin: 12px 12px 12px 0; } .slider-control-paging a { height: 24px; width: 24px; } .slider-control-paging a:before { top: 6px; left: 6px; } } @media screen and (min-width: 1110px) { .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { padding-right: 30px; padding-left: 30px; } } @media screen and (min-width: 1218px) { .archive-header, .comments-area, .image-navigation, .page-header, .page-content, .post-navigation, .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content footer.entry-meta { margin-right: 54px; } .full-width .archive-header, .full-width .comments-area, .full-width .image-navigation, .full-width .page-header, .full-width .page-content, .full-width .post-navigation, .full-width .site-content .entry-header, .full-width .site-content .entry-content, .full-width .site-content .entry-summary, .full-width .site-content footer.entry-meta { margin-right: auto; } } @media screen and (min-width: 1260px) { .site-content blockquote.alignleft, .site-content blockquote.alignright { width: -webkit-calc(50% + 18px); width: calc(50% + 18px); } .site-content blockquote.alignleft { margin-left: -18%; } .site-content blockquote.alignright { margin-right: -18%; } } /** * 12.0 Print * ----------------------------------------------------------------------------- */ @media print { body { background: none !important; /* Brute force since user agents all print differently. */ color: #2b2b2b; font-size: 12pt; } .site, .site-header, .hentry, .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content .entry-meta, .page-content, .archive-header, .page-header, .contributor-info, .comments-area, .attachment .entry-attachment .attachment { max-width: 100%; } #site-header img, .search-toggle, .site-navigation, .site-content nav, .edit-link, .page-links, .widget-area, .more-link, .post-format-archive-link, .comment-respond, .comment-list .reply, .comment-reply-login, #secondary, .site-footer, .slider-control-paging, .slider-direction-nav { display: none; } .site-title a, .entry-meta, .entry-meta a, .featured-content .hentry, .featured-content a { color: #2b2b2b; } .entry-content a, .entry-summary a, .page-content a, .comment-content a { text-decoration: none; } .site-header, .post-thumbnail, a.post-thumbnail:hover, .site-content .entry-header, .site-footer, .featured-content, .featured-content .entry-header { background: transparent; } .header-main { padding: 48px 10px; } .site-title { float: none; font-size: 19pt; } .content-area { padding-top: 0; } .list-view .site-content .hentry { border-bottom: 1px solid rgba(0, 0, 0, 0.1); margin-bottom: 48px; padding-bottom: 24px; } .post-thumbnail img { margin: 0 10px 24px; } .site-content .has-post-thumbnail .entry-header { padding-top: 0; } .site-content footer.entry-meta { margin: 24px auto; } .entry-meta .tag-links a { color: #fff; } .singular .site-content .hentry.has-post-thumbnail { margin-top: 0; } .gallery-columns-1.gallery-size-medium, .gallery-columns-1.gallery-size-thumbnail, .gallery-columns-2.gallery-size-thumbnail, .gallery-columns-3.gallery-size-thumbnail { display: block; } .archive-title, .page-title { margin: 0 10px 48px; } .featured-content .hentry { margin-bottom: 48px; } .featured-content .post-thumbnail, .slider .featured-content .post-thumbnail { padding-top: 0; } .featured-content .post-thumbnail img { position: relative; } .featured-content .entry-header { padding: 0 10px 24px; } .featured-content .entry-meta { font-size: 9pt; margin-bottom: 11px; } .featured-content .cat-links { font-weight: 900; } .featured-content .entry-title { font-size: 25pt; line-height: 36px; } } #reg_passmail { display: none; }
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/style.css
CSS
gpl3
75,740
<?php /** * The Sidebar containing the main widget area * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <div id="secondary"> <?php $description = get_bloginfo( 'description', 'display' ); if ( ! empty ( $description ) ) : ?> <h2 class="site-description"><?php echo esc_html( $description ); ?></h2> <?php endif; ?> <?php if ( has_nav_menu( 'secondary' ) ) : ?> <nav role="navigation" class="navigation site-navigation secondary-navigation"> <?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?> </nav> <?php endif; ?> <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> <div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-1' ); ?> </div><!-- #primary-sidebar --> <?php endif; ?> </div><!-- #secondary -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/sidebar.php
PHP
gpl3
848
<?php /** * The template for displaying 404 pages (Not Found) * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <header class="page-header"> <h1 class="page-title"><?php _e( 'Not Found', 'twentyfourteen' ); ?></h1> </header> <div class="page-content"> <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfourteen' ); ?></p> <?php get_search_form(); ?> </div><!-- .page-content --> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/404.php
PHP
gpl3
719
<?php /** * The template for displaying a "No posts found" message * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ ?> <header class="page-header"> <h1 class="page-title"><?php _e( 'Nothing Found', 'twentyfourteen' ); ?></h1> </header> <div class="page-content"> <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyfourteen' ), admin_url( 'post-new.php' ) ); ?></p> <?php elseif ( is_search() ) : ?> <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfourteen' ); ?></p> <?php get_search_form(); ?> <?php else : ?> <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfourteen' ); ?></p> <?php get_search_form(); ?> <?php endif; ?> </div><!-- .page-content -->
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/content-none.php
PHP
gpl3
961
/* Theme Name: Twenty Fourteen Description: Used to style the TinyMCE editor. */ /** * Table of Contents: * * 1.0 - Body * 2.0 - Headings * 3.0 - Text Elements * 4.0 - Links * 5.0 - Alignment * 6.0 - Tables * 7.0 - Images * 8.0 - Galleries * 9.0 - Audio/Video * 10.0 - RTL * ---------------------------------------------------------------------------- */ /** * 1.0 Body * ---------------------------------------------------------------------------- */ html .mceContentBody { font-size: 100%; max-width: 474px; } body { color: #2b2b2b; font-family: Lato, sans-serif; font-weight: 400; line-height: 1.5; vertical-align: baseline; } /** * 2.0 Headings * ---------------------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { clear: both; font-weight: 700; margin: 36px 0 12px; } h1 { font-size: 26px; line-height: 1.3846153846; } h2 { font-size: 24px; line-height: 1; } h3 { font-size: 22px; line-height: 1.0909090909; } h4 { font-size: 20px; line-height: 1.2; } h5 { font-size: 18px; line-height: 1.3333333333; } h6 { font-size: 16px; line-height: 1.5; } h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child { margin-top: 0; } /** * 3.0 Text Elements * ---------------------------------------------------------------------------- */ address { font-style: italic; margin-bottom: 24px; } abbr[title] { border-bottom: 1px dotted #2b2b2b; cursor: help; } b, strong { font-weight: 700; } cite { border: 0; } cite, dfn, em, i { font-style: italic; } mark, ins { background: #fff9c0; border: 0; color: inherit; text-decoration: none; } p { margin: 0 0 24px; } code, kbd, tt, var, samp, pre { font-family: monospace, serif; font-size: 15px; line-height: 1.6; } pre { border: 1px solid rgba(0, 0, 0, 0.1); margin-bottom: 24px; max-width: 100%; overflow: auto; padding: 12px; white-space: pre; white-space: pre-wrap; word-wrap: break-word; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; } blockquote { color: #767676; font-size: 19px; font-style: italic; font-weight: 300; line-height: 1.2631578947; margin: 0 0 24px; } blockquote cite, blockquote small { color: #2b2b2b; font-size: 16px; font-weight: 400; line-height: 1.5; } blockquote em, blockquote i, blockquote cite { font-style: normal; } blockquote strong, blockquote b { font-weight: 400; } small { font-size: smaller; } big { font-size: 125%; } sup, sub { font-size: 75%; height: 0; line-height: 0; position: relative; vertical-align: baseline; } sup { bottom: 1ex; } sub { top: .5ex; } dl { margin: 0 0 24px; } dt { font-weight: bold; } dd { margin: 0 0 24px; } ul, ol { list-style: none; margin: 0 0 24px 20px; padding-left: 0; } ul { list-style: disc; } ol { list-style: decimal; } li > ul, li > ol { margin: 0 0 0 20px; } del { color: #767676; } hr { background-color: rgba(0, 0, 0, 0.1); border: 0; height: 1px; margin-bottom: 23px; } /** * 4.0 Links * ---------------------------------------------------------------------------- */ a { color: #24890d; text-decoration: none; } a:visited { color: #24890d; } a:focus { outline: thin dotted; } a:active, a:hover { color: #41a62a; outline: 0; } /** * 5.0 Alignment * ---------------------------------------------------------------------------- */ .alignleft { float: left; margin: 7px 24px 7px 0; } .alignright { float: right; margin: 7px 0 7px 24px; } .aligncenter { clear: both; display: block; margin: 7px auto; } blockquote.alignleft, blockquote.alignright { border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(0, 0, 0, 0.1); padding-top: 17px; width: 50%; } blockquote.alignleft p, blockquote.alignright p { margin-bottom: 17px; } /** * 6.0 Tables * ---------------------------------------------------------------------------- */ .mceItemTable { border: 1px solid rgba(0, 0, 0, 0.1); border-width: 1px 0 0 1px; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.2857142857; margin-bottom: 24px; width: 100%; } .mceItemTable th, .mceItemTable caption { border: 1px solid rgba(0, 0, 0, 0.1); border-width: 0 1px 1px 0; font-weight: 700; padding: 8px; text-align: left; text-transform: uppercase; vertical-align: baseline; } .mceItemTable td { border: 1px solid rgba(0, 0, 0, 0.1); border-width: 0 1px 1px 0; font-family: Lato, sans-serif; font-size: 14px; padding: 8px; vertical-align: baseline; } /** * 7.0 Images * ---------------------------------------------------------------------------- */ img { height: auto; max-width: 474px; vertical-align: middle; } .wp-caption { background: transparent; border: none; color: #767676; margin: 0 0 24px 0; max-width: 474px; padding: 0; text-align: left; } .html5-captions .wp-caption { padding: 0; } .wp-caption.alignleft { margin: 7px 14px 7px 0; } .html5-captions .wp-caption.alignleft { margin-right: 24px; } .wp-caption.alignright { margin: 7px 0 7px 14px; } .wp-caption.alignright img, .wp-caption.alignright .wp-caption-dd { padding-left: 10px; } .html5-captions .wp-caption.alignright { margin-left: 24px; } .html5-captions .wp-caption.alignright img, .html5-captions .wp-caption.alignright .wp-caption-dd { padding: 0; } .wp-caption.aligncenter { margin: 7px 0; } .wp-caption-dt { margin: 0; } .wp-caption .wp-caption-text, .wp-caption-dd { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-size: 12px; font-style: italic; line-height: 1.5; margin: 9px 0; padding: 0 10px 0 0; /* Avoid the caption to overflow the width of the image because wp-caption has 10px wider width */ text-align: left; } .mceTemp + ul, .mceTemp + ol { list-style-position: inside; } /** * 8.0 Gallery * ----------------------------------------------------------------------------- */ .gallery .gallery-item { float: left; margin: 0 4px 4px 0; overflow: hidden; padding: 0; position: relative; } .gallery-columns-1 .gallery-item { max-width: 100%; width: auto; } .gallery-columns-2 .gallery-item { max-width: 48%; max-width: -webkit-calc(50% - 14px); max-width: calc(50% - 14px); width: auto; } .gallery-columns-3 .gallery-item { max-width: 32%; max-width: -webkit-calc(33.3% - 11px); max-width: calc(33.3% - 11px); width: auto; } .gallery-columns-4 .gallery-item { max-width: 23%; max-width: -webkit-calc(25% - 9px); max-width: calc(25% - 9px); width: auto; } .gallery-columns-5 .gallery-item { max-width: 19%; max-width: -webkit-calc(20% - 8px); max-width: calc(20% - 8px); width: auto; } .gallery-columns-6 .gallery-item { max-width: 15%; max-width: -webkit-calc(16.7% - 7px); max-width: calc(16.7% - 7px); width: auto; } .gallery-columns-7 .gallery-item { max-width: 13%; max-width: -webkit-calc(14.28% - 7px); max-width: calc(14.28% - 7px); width: auto; } .gallery-columns-8 .gallery-item { max-width: 11%; max-width: -webkit-calc(12.5% - 6px); max-width: calc(12.5% - 6px); width: auto; } .gallery-columns-9 .gallery-item { max-width: 9%; max-width: -webkit-calc(11.1% - 6px); max-width: calc(11.1% - 6px); width: auto; } .gallery-columns-1 .gallery-item:nth-of-type(1n), .gallery-columns-2 .gallery-item:nth-of-type(2n), .gallery-columns-3 .gallery-item:nth-of-type(3n), .gallery-columns-4 .gallery-item:nth-of-type(4n), .gallery-columns-5 .gallery-item:nth-of-type(5n), .gallery-columns-6 .gallery-item:nth-of-type(6n), .gallery-columns-7 .gallery-item:nth-of-type(7n), .gallery-columns-8 .gallery-item:nth-of-type(8n), .gallery-columns-9 .gallery-item:nth-of-type(9n) { margin-right: 0; } .gallery-columns-1 .gallery-item:nth-of-type(1n), .gallery-columns-2 .gallery-item:nth-of-type(2n - 1), .gallery-columns-3 .gallery-item:nth-of-type(3n - 2), .gallery-columns-4 .gallery-item:nth-of-type(4n - 3), .gallery-columns-5 .gallery-item:nth-of-type(5n - 4), .gallery-columns-6 .gallery-item:nth-of-type(6n - 5), .gallery-columns-7 .gallery-item:nth-of-type(7n - 6), .gallery-columns-8 .gallery-item:nth-of-type(8n - 7), .gallery-columns-9 .gallery-item:nth-of-type(9n - 8) { margin-left: 12px; /* Compensate for the default negative margin on .gallery, which can't be changed. */ } .gallery .gallery-caption { background-color: rgba(0, 0, 0, 0.7); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; color: #fff; font-size: 12px; line-height: 1.5; margin: 0; max-height: 50%; opacity: 0; padding: 6px 8px; position: absolute; bottom: 0; left: 0; text-align: left; width: 100%; } .gallery .gallery-caption:before { content: ""; height: 100%; min-height: 49px; position: absolute; top: 0; left: 0; width: 100%; } .gallery-item:hover .gallery-caption { opacity: 1; } .gallery-columns-7 .gallery-caption, .gallery-columns-8 .gallery-caption, .gallery-columns-9 .gallery-caption { display: none; } /** * 9.0 Audio/Video * ---------------------------------------------------------------------------- */ .mejs-mediaelement, .mejs-container .mejs-controls { background: #000; } .mejs-controls .mejs-time-rail .mejs-time-loaded, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { background: #fff; } .mejs-controls .mejs-time-rail .mejs-time-current { background: #24890d; } .mejs-controls .mejs-time-rail .mejs-time-total, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { background: rgba(255, 255, 255, .33); } .mejs-controls .mejs-time-rail span, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { border-radius: 0; } .mejs-overlay-loading { background: transparent; } /** * 10.0 RTL * ---------------------------------------------------------------------------- */ html .mceContentBody.rtl { direction: rtl; unicode-bidi: embed; } .rtl ol, .rtl ul { margin-left: 0; margin-right: 24px; } .rtl .wp-caption, .rtl tr th { text-align: right; } .rtl td { text-align: right; }
01-wordpress-paypal
trunk/wp-content/themes/twentyfourteen/css/editor-style.css
CSS
gpl3
10,293