|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////- G3 d$ f$ {$ l/ z' b! V
// Theme Option
' o: K' h2 d0 ^: q////////////////////////////////////////////////////////////////////////////////0 h- H. H# J, X6 ^
/ M/ O3 t4 f5 _$themename = "Zenx";
7 E, k; l+ R9 r- N$shortname = str_replace(' ', '_', strtolower($themename));# c3 Q6 C! _% I
' q" c& m0 [+ `' l6 qfunction get_theme_option($option)
4 W4 E5 R" @$ e. K( U7 V{( h; f5 @4 J8 ^( [5 H+ }
global $shortname;9 @0 M3 Q9 M9 _1 t+ k+ h
return stripslashes(get_option($shortname . '_' . $option));
8 w( G" n3 `6 R: k}
; _+ b+ |) a( ?! c* ]1 C" V3 g. E6 v$ d) _0 n) p+ w
function get_theme_settings($option)
@! h3 e3 x% T/ u% c' W$ k{
* y7 H7 h0 q1 I$ K P$ k3 ] return stripslashes(get_option($option));
9 ]) _7 |( W/ u}
?/ r# h' n5 c; U6 Z$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");* Q4 w" w1 q9 F) m) w6 Z8 L
$wp_getcat = array();
- x) R# f' @4 `2 o- ~7 f |foreach ($wp_dropdown_rd_admin as $category_list) {
( k1 F/ m: I# d8 [# ]9 |$wp_getcat[$category_list->term_id] = $category_list->name;
; ~/ A% b Y7 z, `4 |( H/ f}- L' O) U9 }+ j
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");5 c" W7 M! a( w2 u1 Y
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");; W7 S) c: Y1 p- |4 L/ q1 ^ a: y
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
$ q/ M* u& Q& S9 o" z2 X# T& y& D$ n. _8 U/ Z$ U
$options = array (
/ I9 o! }% |+ o5 z% v* F! `% A# @% Y/ ]/ ~9 J( _* ~6 D
4 C' N6 m) V8 K array( "name" => "Blog Header Settings",
7 r; T: R0 Z1 v/ T; o. J9 x2 B "type" => "heading",
+ C" o; i+ E G/ f6 I# L ),; r8 g* u7 P3 i7 [1 W/ [- L
, d, B' |9 X. I& \! m9 R9 ^: K+ m$ b array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 e" H7 \- _# e& f9 L0 A% T "id" => $shortname."_header_logo_activate",
' N$ E- l& X3 T9 Y- V- E6 P "type" => "select",: `, w/ P& B" T
"std" => "No",
; v _$ m1 B! N, W1 O "options" => array("No", "Yes")),- O* W V( J" c3 i
7 _( |6 k7 X, r) L s
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",. x1 J- J3 q `
"id" => $shortname."_logo_url",
/ V7 X0 C9 {5 j# r1 G, z "type" => "text"," K# D! A* `2 j% c# d' T1 c: F$ h
"box" => "social",+ e9 ^8 g7 o3 w) q3 J" h9 T+ _
"std" => "",8 j- e0 @) q; T- c$ F# j; ?7 J. F
),( y2 o* q- k7 [$ s
! w6 V5 B3 L" X! } array( "name" => "Insert Header Banner HTML Code (Header)
9 |6 Q8 [/ i( i# ?9 K: f$ C9 g9 p <br /><em>*Recommended Size 468 x 60</em>+ W4 } O' c/ @& R
<br /><em>*leave blank if not use</em>",8 v6 n! z5 F0 M U! ~* C! K
"id" => $shortname."_header_banner",
' L8 j+ s+ w6 i4 X( x' `! G. Q- V3 y V "type" => "textarea",; j8 M9 I: P1 |3 j
"std" => "",
+ e1 i8 M* D* H0 I ),: |$ m( g# X5 h" x2 L2 S+ T# A
6 J- Y/ j' K7 l0 D
array( "name" => "</div></div>",* X0 X9 B! m( h
"type" => "close",
3 K( ^( A, m5 f; A ),. a6 q" F3 n+ h4 f& X
% [; x3 Q4 _- F! _9 o
$ F: V8 {% q3 j0 L array( "name" => "Header Navigation Settings",
: M; C' t# u8 b$ t& B "type" => "heading",( `) v+ i1 e0 K# i2 w, E
),
/ {, W- j1 ^' @: [
- f2 a( _" t& G+ m5 p2 F array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
/ Y3 j, Y, h5 U. H Y <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
" i/ a3 P9 n2 _; D# X# M; t- v <em>*Enter the page post ID number only</em><br />
0 ^- X7 E* l6 W. d# l7 H' N7 m <em>*separate by comma</em><br />
$ n5 ~$ Q- d7 ?- [% j, E- _6 w T <em>*Exclude pages which you don't want to show on the header navigation</em>",: }9 ~' g0 D5 h
"id" => $shortname."_header_page_navigation",* r6 f# P/ |2 c0 J: e6 q6 u
"type" => "text",2 r ]8 j, h& w3 a! s% p. {
"std" => "",) J, X/ _ a1 `; ~" G2 F" \
),; F3 t/ W5 W* V
$ [8 | B3 p3 g/ A1 u0 H% y array( "name" => "</div></div>",
- S3 t3 v, X4 v# }6 [ "type" => "close",4 S$ @: s! C6 @2 Q9 X3 Y( M
),
' K: z) ^* U1 U- N# x }9 `. G
! }( V0 g( m; a& q3 h$ V( C1 H
) R0 J3 Y' D7 s v: u; @9 Z# E array( "name" => "Post Auto Thumbnails Settings",
! m1 w) A. W* I1 s% } g/ [4 d "type" => "heading",
t% A2 e( ]# v) _+ D) m ),+ ^4 @+ Q/ v2 d$ F3 y* Y: t- q
: h* ~9 t* O, n4 l: a& j8 ^ array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& E# e+ n8 G* Y( q, i7 K
"id" => $shortname."_timthumb_activate",! d6 \9 Q9 ^ d! M% _* D! {
"type" => "select",
* a* n% `8 y8 \" S$ ` "std" => "No",
- W( ?; F8 y p! X' v$ c "options" => array("No", "Yes")),7 Y$ ?# w+ u9 A) ~
4 S/ M1 G/ c; U z* i& @ array( "name" => "If Timthumb is enabled, Please choose its cropping method",
4 \6 J0 m- I8 t4 ` "id" => $shortname."_timthumb_cropping",
( {8 O' P7 z3 n/ Q3 \% @ "type" => "select",
3 ~6 T, }6 K6 e, ]; s* u "std" => "",
% O! r* G1 N/ K6 E5 i "options" => $crop_position),% U9 Q2 G# C# {0 F, ~
/ L$ m Y8 d. R# {- T3 c& M5 D array( "name" => "Insert Width Of Thumbnail Image<br />/ S1 V" ?) F6 [$ d
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
' G' T7 S! T1 k: ` <em>*Leave Blank To Use Default: 250</em><br />",
9 ~* t% V/ q3 m' _ o6 \ "id" => $shortname."_thumb_width",
' S" q6 I5 Q+ o/ o "type" => "text",
+ b' t1 `4 ]7 J4 k7 D O6 {& g "std" => "",
' }0 \; X/ c& r2 y1 {! n' t ),/ H! n3 q$ f$ G3 t5 M1 h2 p6 c
! Q7 x( C( |% b8 q2 h O& P array( "name" => "Insert Height Of Thumbnail Image<br />+ l% E+ c! P1 w) M( o9 m2 Y
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />; M4 _; W+ T( a- L! J
<em>*Leave Blank To Use Default: 200</em><br />",
5 l- B0 \% c' R4 V. a; X/ ?6 t& w "id" => $shortname."_thumb_height",
8 y2 a$ k6 x$ J$ x/ Y "type" => "text",
, U" L9 X6 i" C "std" => "",
4 D: L1 b; D; w" ? ),% [& L. _4 h+ o1 |& ?
2 u; ^' J9 K- E4 v1 C% \
array( "name" => "</div></div>",
- i" `0 t$ N( m% L "type" => "close",% s: _ Q. u+ ]5 P* k- Q/ M) W
),, m) Z7 F+ u9 Q( B- v8 A7 Y
( `0 H8 l) N. a0 h5 N0 m5 R
array( "name" => "Featured Content Slider Settings",! J% J/ N4 a; _ g6 X' Q7 e; ?
"type" => "heading",
4 m' _7 S3 O6 c2 X& ` ),3 y. u0 \( u; {! d- C
$ h3 d4 M$ ]5 q! d3 B/ M' ?1 [
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! \7 f' ?1 j w% G' ~ "id" => $shortname."_featured_activate",; x8 m* E- ]% B4 D
"type" => "select",5 ^4 V5 B) d6 w' _7 @8 ^
"std" => "No",
F# y/ a( i" l" E, m6 u( x "options" => array("No", "Yes")),
% t1 `! _6 e2 f. C$ C1 c: p9 g/ B5 c$ X
! k! A2 T0 O8 v' n7 t
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",$ h- Z' I1 [5 u' ^1 ~
"id" => $shortname."_featured_category",
$ y& Z8 q) ]! c "type" => "select",
, H% ^- a9 v( F2 g# h7 a1 }% l' d "std" => "Choose a category:",' V T$ G' Z( N; J$ R. W9 z
"options" => $wp_getcat),
" L: P; Y8 I: c( x' O! L
$ x7 c/ d( s7 o! A0 J array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
' _& \+ e1 N: ?5 m6 k" g "id" => $shortname."_featured_number",
8 j K, a8 {7 ?5 r/ T" p n "type" => "select",& S3 {9 W& } V
"std" => "Number of post:",+ z4 E, r- z+ c, x( C5 z
"options" => $number_entries),
y) D- P1 u+ b' _2 ]: R/ C( V' x: v' s% S: X* U4 G3 w
array( "name" => "</div></div>",
" E" I9 d( D0 m; f1 @ "type" => "close",
# v8 F- o" m4 L# i ),0 v; F& ^4 [4 Q: O( e. _! u3 n
! {8 V3 o2 U9 K array( "name" => "Featured Category Settings",
9 A( k* s2 L2 ^2 }' I% [9 g, ^ "type" => "heading",; R- \8 d/ _' P) B
),
0 Y& u, h) t& P* |' R A
7 `+ ?$ C8 y5 ?( i array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% c4 N) c2 r$ c. ], {2 H; H "id" => $shortname."_featured_category_activate",5 W( Y% W6 `3 r4 H( Q' [3 \0 s
"type" => "select",
0 ?) S3 ^! n6 `4 M& Q "std" => "No",
4 @# L: ]: T: {) o "options" => array("No", "Yes")),
5 J* `' m& z5 o) }7 H! }
" D; K% u) ]5 p D+ K$ C" Y% h array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
) C7 \4 F* u, M) e U1 C1 t "id" => $shortname."_featured_category_id1",
7 _: u* v, ^9 ]7 k "type" => "select",# t7 X2 u. V* w6 @0 a0 w
"std" => "Choose a category:",' B$ l* F2 r3 E6 Y W1 y# u/ N8 j
"options" => $wp_getcat), w, a f. I( \' K
6 N% Z r3 `$ _. f. N9 \
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",, o q, o1 s, u1 S1 `
"id" => $shortname."_featured_number1",
) U% L( b3 r$ w2 m% a9 q5 S' G "type" => "select",
5 o) A0 q; e' S "std" => "Number of post:"," L/ V5 D- O7 v9 c0 V
"options" => $number_entries),/ u: J: D) U2 R& `" P( X- w
* R- q% J+ V* N! N array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",6 ?7 L. N3 d" d; |$ ^% H
"id" => $shortname."_featured_category_id2",
. O* Q: Z( e/ W" S+ [ "type" => "select",
' {$ d0 b2 u2 d5 G2 g9 m "std" => "Choose a category:",8 ~$ q& i6 ^3 o3 [: y
"options" => $wp_getcat),
+ d: i0 |; h4 o6 X % M! F7 a# f. D$ Y- I# R8 }
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
, @& v4 |# m/ o* n4 Z* t: a "id" => $shortname."_featured_number2",
: f4 c/ k* }! A' L "type" => "select",
% U4 V* ` O! I! {! o! u/ l7 ` u* R "std" => "Number of post:",4 b0 Y8 m$ }. ?! b+ n% }4 z$ J. K
"options" => $number_entries),
! I" a3 u5 r! k! E4 l$ x. y 0 y9 j* y5 ^! E" H0 s; P8 }; B
5 s1 p: z) z7 {$ v array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
& l* h3 D: L3 b0 {; k "id" => $shortname."_featured_category_id3",0 i/ l" o4 N# W
"type" => "select",
( g6 W! I5 F% K2 {- M "std" => "Choose a category:",
6 I$ i, i4 |: v; q. e h "options" => $wp_getcat),
4 P! N/ h9 W/ `' X; X , k& q1 D- A) O8 }! f# v3 d
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",; d7 W- \# g$ g1 I1 o
"id" => $shortname."_featured_number3",6 X' ~& w. b9 H% h# |
"type" => "select",
. {6 u7 S, x: K! M- x' S "std" => "Number of post:",# Y( w- |. ?6 }1 f0 k; X
"options" => $number_entries),2 m7 A, _ f$ D9 E, H( x
, h1 |, x; _4 ~3 E
- A- P$ U. S2 M0 ]! u% X" D array( "name" => "</div></div>",- D5 y" {: }- r
"type" => "close",
* i7 h2 P. f4 S1 z ),
/ N/ W7 I+ v5 X- [2 k
! ?5 T5 W7 Z% G$ ^1 i; C5 Z
. W. d' A8 z+ I: v( `* [ array( "name" => "Google Adsense & Analytics Settings",
" x# i5 f* f5 F9 j3 S% ~( I "type" => "heading",' a' j! v8 m0 G$ D( _' C0 z
),
) ^1 N0 c. \. `9 w f; y {2 K& D+ V3 V, n* O
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",2 M+ U# j' B! ?8 F
"id" => $shortname."_adsense_loop_activate",8 @2 \: l, ?- A+ _
"type" => "select",
' U) m, r: G8 S4 p6 [' D# `, n "std" => "Disable",+ D+ g2 G* ^5 X# S
"options" => array("Disable", "Enable")),
) b9 y" m" U* r8 A5 |* r; I4 q
( ]3 V9 N' n9 X5 b+ b+ k) u1 A array( "name" => "Insert Google Adsense Code For Loops Here<br />* f% w7 S5 [7 [4 {: ?
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; D6 S* {! @9 I6 i
"id" => $shortname."_adsense_loop",
! c t2 J" r/ R9 ^0 y4 i- M# ] "type" => "textarea",3 q+ \& Q' ]: m3 {6 y, o
"std" => "",
\7 ?$ z2 X3 x: Y) l ),
1 [) g* H1 v6 E- S! \# h# X0 U( u* r1 H8 v s! U% c
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
8 O. d( `" k; p! B- R "id" => $shortname."_adsense_single_activate",
. W* ^! l+ {3 ~& v "type" => "select",) b0 l& n8 S3 F
"std" => "Disable",
) L! j8 P* V8 D) U "options" => array("Disable", "Enable")),8 }/ \' Y9 r% |6 J, S
$ X# n, O% x9 b |8 Y: E) V8 F array( "name" => "Insert Google Adsense Code For Single Page Here<br />. e3 }& K4 O$ P
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
1 _( C% `7 T% r5 W& o" v6 m "id" => $shortname."_adsense_single",9 i0 N: P; K4 g8 x3 t' ^
"type" => "textarea",1 t. T3 B" X' K. n8 V; I
"std" => "",& a0 i2 G# O( L8 A D
),! e& z0 _( L# L) R/ j8 P6 ~: c) g( f
8 Y$ G1 n, w7 f1 R0 o
, c' y _! h! q# o7 ]
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
( D8 K A) R$ E6 ~ r5 K3 z "id" => $shortname."_google_analytics",- Y! z; n7 ^6 t& E: }6 |9 Z
"type" => "textarea",
; h2 N J, z2 [: A, n( ` "std" => "",6 ~& z# P X0 E2 u
),
0 C5 z3 K. d6 E: w8 ]# m5 P! D; E& n( `
array( "name" => "</div></div>",$ l: n& ]" p! f6 s( h1 [
"type" => "close",
( Q+ S4 }5 p- `3 `6 H# P ),1 c; x; Y( ~* D9 k# P
! ]6 K% @, [6 s2 ?2 K! y A) N# [ / A3 ?" f. b$ v0 x1 r; t6 t
array( "name" => "AddThis Social Bookmarking Settings",( Y: j. ~1 X7 O
"type" => "heading",' e0 Y- c4 r- N- c9 q% E
),! r# t+ H6 Z. S! T; b! |3 p K
4 v8 p+ i$ q5 a/ }6 S) P
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>* i C6 E) N; W7 P" ^9 {
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
4 G( N' I; O6 @' T( R! ^ "id" => $shortname."_addthis",
# y0 M8 V, H4 g# X+ T1 J "type" => "text",
4 {8 t* |9 b: R, w! V; S# U "box" => "social",: s d% I- u% I6 V0 A6 c5 ]: q5 x
"std" => "",
+ F! w) F" Q/ D; G* \$ R2 r ),3 O9 ^- A! X9 F5 X7 P: S) O7 V* v
' N. m8 {7 z. V- p
array( "name" => "</div></div>",
/ I, u+ F! V' }# Z' u- \ "type" => "close",
* `. R1 ~( V# P7 L+ ] ),
a$ e+ x ]' \
8 i, o% W _" N2 j
5 E) \6 M4 b4 c0 }% z5 g- w* i
( N$ d' G3 K5 f- R7 d" X& C0 ^ array( "name" => "YouTube Video Settings",
* U) |% g! p6 p "type" => "heading",
, N+ J. `' l8 K* Z ),
7 J- n9 P1 y2 W+ B, J% X* l% M0 ]3 Y5 [; [
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ l! J p# y1 K* j7 }+ L9 V4 [
"id" => $shortname."_emvideo_activate",( g% k3 q' [) b$ v- E
"type" => "select",
+ p1 s: J! @5 h5 G "std" => "No",
: ]5 O# B9 U3 M6 J- U4 h "options" => array("No", "Yes"))," x" U8 K! a; [% g! {! e
! L% t7 R3 v& w$ Y2 V: w. D$ F array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
' d% x& m! J n% q2 G- ~% M "id" => $shortname."_emvideo",! R4 @7 O1 C/ Z! w& U
"std" => "",# X) b* t, ]2 k% a% \$ x7 K p
"type" => "text"),8 E8 ]# N7 M/ |( P
3 a: K2 N! F+ g array( "name" => "</div></div>",, Q2 ?8 v* f; b- Q7 o
"type" => "close", E; G: B* @) P- w; p$ j9 e, m: U' Q
),
% x& R" d6 W2 q7 o! R8 _! d 4 a; d* n! W$ H# T$ k" a( G' I4 W, M
array( "name" => "Twitter Settings",1 X s A% |1 l3 c/ U% }9 F- {! u
"type" => "heading",
1 M" p$ K) A3 Z2 o7 H* a- w% J ),
5 ~! b2 y! M3 h5 o6 [! o. b/ v% h* ^8 M
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
9 S% U0 k4 \8 U6 W "id" => $shortname."_twitter_activate",) |$ k" X0 F( f- F- P3 ]; p& [
"type" => "select",& C, ]0 V9 i' s7 z2 I: p
"std" => "No",7 A v- c8 h. Z: o
"options" => array("No", "Yes")),
% `) Z; B- W. ~# I9 T8 n" J/ e
5 F9 r7 `/ p' Q array( "name" => "Insert Your Twitter ID here$ `9 ]+ ~6 Q0 F2 R9 P$ e
<br /><em>*leave blank if not necessary</em> Y/ S% N. I( G; p U i
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",! o% [: _2 P# ~! Q
"id" => $shortname."_twitter",
/ f& z2 ]7 `) ? "type" => "text",/ Q9 [! {' J% l" i
"box" => "social",
: F- I# d% y" O* y% I$ h "std" => "",% H: r( Y: T \) j8 C- O2 K! \
),) S+ c+ r9 s9 L: u! c* ]* o+ R
; Q: I/ [9 @6 I) K array( "name" => "Enter Twitter Feed Count here
! [6 x9 p1 I& U0 } <br /><em>*leave blank if not necessary</em>4 [- s. l- k0 G$ L7 _9 o9 R
<br /><em>*Enter How Many Twitter Feed To Display</em>",4 y) Z% |% f) a# | b0 J; R
"id" => $shortname."_twitter_count",: |) S/ S, @+ E. h
"type" => "text",
& S8 A0 m8 H [ "box" => "social",
: g. J/ B# O& |3 q: L! h' P "std" => "",0 b$ m& |6 E! c! E9 ^
),
/ x) c3 x! C- f
d2 d1 D/ u) j1 p+ ?, ? array( "name" => "</div></div>",
& @ w' L4 z0 n4 o0 Y8 D e6 } "type" => "close",
7 ~2 z2 A+ A' m3 Q7 [1 | ),* Z# N5 C9 J1 Z0 L
! d9 w" A" v" n3 u9 y5 ^
# a7 W6 t2 I1 j% A6 O& u) c- O2 u( G
array( "name" => "125 x 125 Banners Advertisement Settings",
7 G& Q( f& v1 k- u. E! b' k "type" => "heading",
; G! p2 M/ F. u4 C( U ),
3 f( s( r+ J0 _7 v9 ?2 C
. {7 G5 f O, R& }4 h* H( }6 ~ array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",, J* |2 c' e r9 h/ v
"id" => $shortname."_sponsor_activate",
9 E+ l: w6 S/ `9 E "type" => "select",; H4 S0 @. a3 {! F6 C7 \
"std" => "No",! S/ b, O+ a4 E6 p
"options" => array("No", "Yes")),
5 p! ^& G0 }* j9 R6 b5 r $ ?" ^( O' x* o' `6 z
& B5 Y: u' E# i array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",9 O, m! _2 p$ r
"id" => $shortname."_sponsor_banner_one",1 q' {* f. K9 x d9 V1 V
"type" => "textarea",# A9 ?7 J" l2 g, l- C0 R
"std" => "",1 |( r2 M! v+ U2 y: j# u$ x0 q4 V
),
$ L5 I3 C5 h9 J& e/ i' ~$ E1 \3 Z! n# h! W
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",5 |( i" Y% I0 x2 [4 V' }( }
"id" => $shortname."_sponsor_banner_two",4 a! Q* r2 s/ _3 l3 S$ x
"type" => "textarea",2 r0 r7 y! `- P6 E
"std" => "",+ q5 \ u; o5 w8 K2 i2 W; Y
),; k. b) }3 b" v' a
# r+ T" F' F0 z. |: T
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",6 T: i2 J; O( @- h. Q: O
"id" => $shortname."_sponsor_banner_three",! @- k; R2 B1 N2 N
"type" => "textarea",
3 I( G% m8 J4 k" m5 b "std" => "",# E9 H& Y) x1 _! `; U4 w( L& n
),
5 p$ v* U H4 \, i$ H
% t. Z0 x' p& p5 w) X9 o array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
+ X, h3 _. n- k! W9 R "id" => $shortname."_sponsor_banner_four",4 |8 A/ A$ J. z/ r3 l
"type" => "textarea",
8 `# {5 M# B% | "std" => "",
3 c. {% ]! n. ` ),4 Q3 D4 q% G4 `% B: {* @
* ]8 j. a+ A1 E
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
" J* t& [+ x# m; v "id" => $shortname."_sponsor_banner_five",5 b! [* ]# V( H2 `$ r1 u% G
"type" => "textarea",5 {8 o) b8 r5 H; r" X6 S' s
"std" => "",8 k9 ]8 E7 ]$ H' f9 ^% g
),7 p6 [/ J& ^9 J, _
+ D6 Z( `) h+ Z# ?! z5 \ array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
. W1 o% V% U1 j# N! g( `; a V "id" => $shortname."_sponsor_banner_six",' s1 j' R4 S, O1 V3 W1 p3 ` a
"type" => "textarea",
$ V8 H$ `8 V( ^) ~$ l" k# W "std" => "",
# I. G6 |' ]- w4 K; p1 S ),
+ t4 @! e. d" l* N6 d1 I @ s( K# C
* ?" e7 M) ~) z9 c7 E array( "name" => "</div></div>",! Y/ [7 d$ b) T5 Y; }
"type" => "close",
& x B" ~" O2 b3 b2 n4 u. z ),
7 Y. T3 w1 ^0 w' Y, @2 A7 j
* }1 m& i! F. M5 |8 Q# R$ o/ n% u% a& U0 C# F. M
7 B! r* X+ a- @: O- N; r: D# R& P);
# [4 N3 d: i; h! r4 v4 ]. M6 {2 {$ f' ] [" t- v! Z @
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
& [6 k% _7 A8 Y* L' F/ L% d- V( j& |' r+ v7 q% m* m
echo "<div id=\"admin-options\"> ";
( F! ^9 B2 N5 [8 F. B# x& E' [1 l9 j' Z/ O$ u
global $themename, $shortname, $options;
- B. _9 K/ p$ h) T5 ?if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
3 g& r# R# B8 o7 f1 v- xif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
0 U* F/ N0 \2 b?>2 g$ w. o0 M. J2 o) [
0 n4 q; A: ~4 ]9 Z0 Z3 l
<h4><?php echo "$themename"; ?> Theme Options</h4>
$ e) _0 A" z/ p! Z7 @- c l
6 v g( H! Q: o+ M<div class="annouce"> E! r1 |( n- V* h: I+ n$ O- ]
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>4 |2 T" @( b; n" [/ O1 ?1 n
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
& N! w% Q! x: b! C( q7 n9 g4 T7 \</div>/ M7 I U" M7 U3 j* L% |7 J+ Q7 }
- ?% k Z( d0 }) b/ ]
<form action="" method="post">& I# s* O; B3 W/ m/ I" z# L# l
+ y$ {) L5 z2 h$ Y j: D
<?php foreach ($options as $value) { ?>. ~# x, k( ^/ v9 q$ B4 k
6 T/ L+ V- J. \
<?php switch ( $value['type'] ) { case 'heading': ?>
, I. {3 @6 _$ H, u$ @4 [
$ W4 W0 k) L& _/ @/ i8 u- X: e<div class="get-option">
8 m1 e' l) i1 {& d# s. ^ {* Z3 N9 Q/ `! V [3 a
<h2><?php echo $value['name']; ?></h2>. ~) y1 l+ S t. k3 g8 v
; G c/ f2 m( p! J. v9 w8 x S1 c
<div class="option-save">
" I L4 N: g: {. r9 p
! \: d: r+ F5 h) a2 M+ g+ F<?php
' B" U& Y* Q7 v' x0 @) _break;( C+ x9 V2 g1 H$ g: M0 K
case 'text':
4 B; p W' D! Z( |: y7 S( ^2 a?>
) g: F* @& d; l) A
( f) K" d4 i3 d: P<div class="description"><?php echo $value['name']; ?></div>5 {, x' Q- Z( f) O# ~
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (8 b6 p g. X/ b4 {
! Y! L) @' P0 s" rget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
0 p4 r6 q/ Z( S8 _' P( Z5 U" }% X; _& b, [( e$ w
<?php
0 s5 ^3 f; M; k, p- Obreak;/ Y& T2 X1 v3 F. g9 d7 J
case 'select':" ~2 U6 b6 M6 x# ^+ m
?>, F) @: T* J5 K- i: i
- [+ t0 c+ ^- M3 \& H1 f; I. M<div class="description"><?php echo $value['name']; ?></div>
1 F- d. J8 V( g4 a' s<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
& @# r2 G" R- e4 @ j5 p$ u<?php foreach ($value['options'] as $option) { ?>
x6 H. U6 \% k2 ^! O) |<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
+ ^# `7 |& J7 g) Y- a& G; M2 F<?php } ?>, b: ~ l2 t8 w4 V- l( U* A
</select>; w h1 o' R7 x- B$ \9 {
</p>
( ]1 R* \$ ?$ v7 o0 ]$ w. i, O9 S3 B. O1 Y1 z' P
<?php9 }0 o# }: E" A+ t+ ?
break;
; F& C. L' r+ h& ]case 'textarea':, J, v# O5 U: Q$ t9 g
$valuex = $value['id'];
% Y% ]1 F' a3 [4 o6 Z- I9 ?; b$valuey = stripslashes($valuex);6 t T8 j8 o; N/ W7 @5 c' c3 ]' }9 h
$video_code = get_settings($valuey);
: X" j2 w2 d" E2 a) W?>1 l( d# S( o) [% X
- e0 t8 u, ~" x; Y; v9 G
<div class="description"><?php echo $value['name']; ?></div>
5 a# B1 F* v: e4 }; x" E<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }/ `( [8 P; g1 x1 X( p
' R0 f7 T4 H r+ K3 selse { echo $value['std']; } ?></textarea></p>
% ^& k$ m3 @. j% H
& f, m4 G# ?8 p5 A: w1 l<?php1 v2 ~% B1 p o" _4 G/ j
break;8 T3 ?* R( ?7 W: S5 d
case 'close':! h( D4 N& D; n7 |
?>+ p9 [6 Y9 |( O+ t
* s% _% u5 N! K
<div class="clearfix"></div>6 P+ d3 I/ k2 I% N& O* S$ H' o
</div><!-- OPTION SAVE END -->. l8 n+ b V+ e6 I. R: |
0 G6 M5 N3 {( B! J; f0 q6 e( d" M<div class="clearfix"></div>- F: y' S) H7 I8 Z7 S$ Q2 [/ M! f
</div><!-- GET OPTION END -->/ |3 H" ]/ a3 }
, X6 X7 X' f) q4 U. {
<?php; L; S, |1 m2 Y/ i* A* q/ G: O
break;
* g& C! O8 @% T8 ?+ mdefault;! B. r E2 Y) K4 D! Y" P3 s7 |
?>3 G$ ^9 H& h5 C
& E+ M& Q& [2 O# W5 W# o
7 {/ i$ z* h" K2 D i8 Z! K<?php
% m' X+ p% ]$ Q0 J9 |break; } ?>: `, b/ @! G$ P* c4 b& k
* c6 b- [1 m: v* W$ s$ b
<?php } ?>
3 M o$ I! g% ]9 V2 |" ~0 u5 _6 m% i7 n6 C, c* w# V# `3 B
<p class="save-p">
; l( s9 J; G( f9 P2 _8 {' i+ a<input name="save" type="submit" class="sbutton" value="Save Options" />
1 g3 Y: |3 I5 K! h0 \<input type="hidden" name="action" value="save" />
2 g& E* S: w% f" t, P8 q</p>
( Z/ M$ u6 j# ]& P, ]9 \3 u# U! K( h</form>
/ G1 v6 F3 l( N& V. [/ G
3 s; S3 _, w2 f<form method="post">& Y7 D$ b0 I# V: v2 `9 [0 A
<p class="save-p">
/ h' P8 T7 l- r' K# X3 ^! L<input name="reset" type="submit" class="sbutton" value="Reset Options" />
. D$ {9 r& J7 |, c( Q! `<input type="hidden" name="action" value="reset" />
# O# f+ j+ v3 N4 K& l9 C</p>
* N s4 s, n5 r6 Z* U$ k# q</form>
( o; h; T1 M0 j; @, E, y# A& j) {* |1 I6 s
</div><!-- ADMIN OPTIONS END -->
3 b& x& U0 P- y( `* v% h
. O: \- a9 s1 x/ p3 J1 k( s: g<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
" E M! }! {$ m% l4 D* G6 r/ p' Y" h4 J: z% Q1 ?! B% S {; q
function mytheme_admin_register() {) \; S1 N: g0 M# T
global $themename, $shortname, $options;
' H5 k5 G! n9 b k* ?5 L0 ]) B, K3 Rif ( $_GET['page'] == basename(__FILE__) ) {
/ `* ~9 Z. J0 D4 B/ D! Uif ( 'save' == $_REQUEST['action'] ) {8 X9 o9 A; W# c' p, s" z
foreach ($options as $value) { ]' n9 v: S- `% k4 b% Z2 b, e
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }) n( s( d6 b; e* z
foreach ($options as $value) {( {3 `! O" ^$ ~# P& q
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
3 M7 f1 f: H- |8 |& yheader("Location: themes.php?page=functions.php&saved=true");
" o- B2 T8 H- t* xdie;0 ~! j* O% J6 @ J2 S" c
} else if( 'reset' == $_REQUEST['action'] ) {/ o0 d: F# T( K6 u: Q; d' P: j
foreach ($options as $value) {' P+ J& K9 C2 g& Y9 O' M& A
delete_option( $value['id'] ); } [" n" t; @8 f9 k; M6 L1 l
header("Location: themes.php?page=functions.php&reset=true");- ?; {( k2 E* _, t
die;
2 C. c3 O, y I( v: A) o4 L( `}
% I3 t, V0 C+ W' W L: D}0 u* D9 U- A# x
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
: Z: A: Y8 p' ?9 i}% J, o2 }) W9 a5 ?# R
! L8 n$ v4 @+ w4 `) \6 k6 S
function mytheme_admin_head() { ?>
: b* K5 t0 f; r+ k0 y& q<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" /> t" ]/ m% U- p T; t
<?php }
% e, J! ?; C0 P4 s+ F |
|