|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////5 o9 P+ o: U7 R0 s* q8 x
// Theme Option$ l; T5 n: B# ~2 V A# {
////////////////////////////////////////////////////////////////////////////////
" O; O7 U* ^) B/ T, g/ Z' i( y l" q6 M% ?
$themename = "Zenx";1 g% w% Y1 U- v6 @% K
$shortname = str_replace(' ', '_', strtolower($themename));
, g0 N; Z! Q6 U8 }" ^( a5 G' ]
% {2 w5 a e9 qfunction get_theme_option($option). ?/ P% q x3 Y
{
( k" k( a' f# d( N global $shortname;
7 H9 W2 F- ?( H) d return stripslashes(get_option($shortname . '_' . $option));
2 _2 e& Z+ v) u7 Q$ m3 ?% i$ q. }, J}0 k9 I0 d1 u- n7 _0 o3 s+ e
( `' O( j' l5 z1 H/ s L
function get_theme_settings($option)
2 s& y- [0 D) ~& H# z{: G& n6 u- r: q, ~
return stripslashes(get_option($option));
6 N1 c. y4 _/ C4 S9 t0 @} G+ z1 s' O5 M1 F$ l0 K7 ~4 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");
2 o# H+ d9 @1 W( _ b0 a9 r. P$wp_getcat = array();
. O+ n6 [7 h) |: U( U8 P7 uforeach ($wp_dropdown_rd_admin as $category_list) {3 [8 k5 L$ R- ]9 _4 K, j x
$wp_getcat[$category_list->term_id] = $category_list->name;% M# {5 ?' A- A7 F
}
8 J. u6 n& h8 [1 R$ O+ E$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
" R: l: T: r0 w3 k, x$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
- j" t; a8 w$ A) k, F5 `5 x# D2 |$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
$ k, z7 Y& V, s. w
4 t2 u: ?4 ]# m- m; s% }4 e, T/ K$options = array (% e+ c1 L5 a& S/ [
) n$ u1 `& Y* d- g% Z* f
* J7 l# v) H* G W D) |6 ` array( "name" => "Blog Header Settings",
6 L1 O) w1 j% J" l" t0 z "type" => "heading",
( v8 j3 y1 W9 Q. N, C% x ),3 D! c ^1 z- s
; C8 m" q7 @$ L5 `/ a; S2 d
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; X7 E9 `5 t5 w# t' n
"id" => $shortname."_header_logo_activate",: J2 c" H- H3 q I
"type" => "select",
% y3 M h+ ]2 t3 U "std" => "No",
' ^" }' }5 ~ f7 O+ y0 v "options" => array("No", "Yes")),
/ N. y& H6 V3 I
: w5 l7 F$ B5 N: g array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
, C6 N3 @9 s0 [* ^ "id" => $shortname."_logo_url",6 r5 w4 Z+ ^' V* ]6 T
"type" => "text",3 v1 x0 q, c/ o& m8 d
"box" => "social",: ]% v( z8 n9 ?2 Z, J+ d1 x
"std" => "",
3 |5 x4 O1 k B) u) W ),
g! Q- W( k. y8 P3 y
- V' l- O. |* g6 I) \) q! S array( "name" => "Insert Header Banner HTML Code (Header)
2 L- v/ T- X: y& t4 | <br /><em>*Recommended Size 468 x 60</em>) ]4 G2 F4 A, w1 a
<br /><em>*leave blank if not use</em>",
% Y( s* X" Q9 k8 [0 W6 c) |+ R! g/ } "id" => $shortname."_header_banner",
! ^' [. I6 }6 B "type" => "textarea",) w8 x8 ?) I6 i5 g- a! \
"std" => "",
( B$ z& ~% A" m ),
! o% ~. m" ]) b, }( L0 Y) b6 X8 b2 u8 M' w0 L# Q* l6 A' m
array( "name" => "</div></div>",# G* w' G ~ p+ P/ T6 `
"type" => "close",: q B* k- ]% p3 t
),! w5 V# n9 o" t$ A4 v2 \
/ t# R. ~0 M3 H" u; Q3 r/ W5 Y% B0 A1 H" {
array( "name" => "Header Navigation Settings",
0 x0 {( ^4 u4 j6 \6 [3 q n "type" => "heading",, \, O3 U5 ^" v: q
),, o4 g, i3 V$ b* t! w% \( y- k
) r6 }4 p) e& S( F3 Y7 {
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />0 h- f B# x5 R! U8 \
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />% X4 V8 ]' m) f+ }+ G$ p
<em>*Enter the page post ID number only</em><br />
$ Z$ G( W. P3 \ <em>*separate by comma</em><br />
( s* v8 E4 }* e8 ?3 b( g <em>*Exclude pages which you don't want to show on the header navigation</em>",9 a; g* Z& B2 I- T. b
"id" => $shortname."_header_page_navigation",
8 F$ F2 m+ t) `9 @$ K- H$ M "type" => "text",
l. i% G* V N5 I7 y. H "std" => "",) t5 D3 J# K. {) J4 i
),
; }2 C3 I5 n0 k6 b9 s+ H7 J5 U# `; K
array( "name" => "</div></div>",
+ V' k4 Z/ U- T "type" => "close",
7 I8 N# U( w7 |2 W: w ),
o7 L- s- t7 Y8 v5 @" v' k
, S! L1 c! {. A4 ~) d
3 H8 `1 x' D0 O) {& M& `! f array( "name" => "Post Auto Thumbnails Settings",6 _$ ~# Y h$ L7 c
"type" => "heading",
; r" I: [* `, n% N ), ]# q ]8 r- i* `+ n
5 h+ ~. t- _; j/ v( D+ G& ~& N6 K$ e, P array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) J% V5 q/ ^8 N* X- G
"id" => $shortname."_timthumb_activate",
( k3 R0 s! J- A" |1 M "type" => "select",
# `! [, j6 ^* T* H( e f "std" => "No",8 \) N: z0 X- R
"options" => array("No", "Yes"))," r2 c; ]) ]7 U' }6 M: K
$ A) i" ^5 ^! ~7 f
array( "name" => "If Timthumb is enabled, Please choose its cropping method",3 W2 V& {$ J3 W$ w2 e
"id" => $shortname."_timthumb_cropping",% c7 a3 E# F8 l4 X( \; z) c7 `5 q2 V
"type" => "select",0 q. s3 d6 W/ l
"std" => "",
$ {9 h7 h/ c2 ~- ]8 d# J "options" => $crop_position),/ B+ I. L: {8 A" @. l$ p
9 o* u( Q" k' @ A5 L* X2 X array( "name" => "Insert Width Of Thumbnail Image<br />
7 F7 ^$ J# B( _9 W, z& Y9 E- e <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
4 N) `8 E; M& ?) @9 Y9 ^& k <em>*Leave Blank To Use Default: 250</em><br />",
% x/ T) j6 E8 `1 N0 s- E( v: i+ S "id" => $shortname."_thumb_width",
1 Z( E8 R# N# p1 `4 B5 l! X2 k "type" => "text",6 ]/ Z. ~7 B @3 I' J# u
"std" => "", E" B3 l u0 ^3 J0 e, }
),9 D/ e# X. o& Q
" s0 u+ s( h3 r" t4 B7 l
array( "name" => "Insert Height Of Thumbnail Image<br />4 |* x" z9 L g
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
: a9 |9 P/ g6 a6 C) n8 s3 D <em>*Leave Blank To Use Default: 200</em><br />",$ z; ]! I! |. E/ g
"id" => $shortname."_thumb_height",
! x: R0 {: ^- i4 z" M "type" => "text",& s" c4 [: W- m, g6 h/ g8 z8 m k
"std" => "",
! u* |. U2 [2 Z( v: e ),9 _$ ^" t, \' e- j: t1 y) d* x
- p6 W9 K3 p4 H* h- L8 j5 T9 [
array( "name" => "</div></div>",8 s1 K# p! W7 p2 b: E: X5 X
"type" => "close",4 g5 @% H) A% h+ l/ C, d% V
),8 @. m& |1 e0 r6 ?6 `( D& x K7 c
% }. [7 S$ b; M2 {& U! L; E
array( "name" => "Featured Content Slider Settings",2 Q# z2 C c% f5 g& f5 Y2 h$ m8 D. K
"type" => "heading",# d% L0 O) l1 {# E
),
0 `2 L- B" O2 _3 L
" c" y8 h2 k7 B* V; i: w4 o3 T array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 ?* z- v; N! w# M! j! o5 z
"id" => $shortname."_featured_activate",
N1 Z4 Z' \: L& ~# x0 N1 I& N V "type" => "select",
' e# a: Y( y1 E, M "std" => "No",5 p! _. ^! Z, t/ o- G$ h2 |* i
"options" => array("No", "Yes")),# Q% Q$ G% H* k1 }
! K9 f1 L& T% s) E
- L: a5 V$ i/ T, h8 N array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
7 o* s, Q7 f: d& @. w "id" => $shortname."_featured_category",
! G- }: ] G& Q, W% w "type" => "select",7 s! _/ ^1 q* f7 h& ^; r7 p
"std" => "Choose a category:",
3 u# U; f, w. ^# o5 e9 K V* M "options" => $wp_getcat),; g5 W# V2 y7 p
6 Z' c4 Y; h7 O( |
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
- y: F& Y9 j) H% k# m! ~$ e "id" => $shortname."_featured_number",
b- \6 x( h0 J/ m8 t "type" => "select",+ c: i( Z0 \- ^; n7 H$ A7 o
"std" => "Number of post:",
6 z, h* V4 q2 D9 c. q- G "options" => $number_entries),
! V W1 x9 R6 h9 c. ^9 L& A8 x7 {% H$ t. n) \
array( "name" => "</div></div>",
$ s" \9 Q& V& w2 @0 ^ "type" => "close",
9 e. }8 z7 G1 j ),7 O6 u- I( D- I) q
& Q: X7 k9 {" N2 d3 _) W array( "name" => "Featured Category Settings",
, W0 v+ d; t) R. A, r8 f3 W "type" => "heading",
9 D- i) v. {+ b3 b, P! W ),5 Y7 |8 @3 L, R1 {; Q
, |% n: X K# w8 Q0 m array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! P) m( n1 v6 h# I
"id" => $shortname."_featured_category_activate",
$ ]8 |6 O5 @7 w8 ?4 L9 |; B% b( r "type" => "select",
8 m0 N8 U0 P0 [8 {4 S "std" => "No",
8 W* g3 y8 O, Q" I; q$ b% _ "options" => array("No", "Yes"))," C2 v4 [5 Q5 {. z$ }9 u3 m
% l1 e5 q: N( |0 g( A( i. |2 V+ {
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
6 b2 i, k1 y, `0 d W4 z' k; e "id" => $shortname."_featured_category_id1",$ q) y9 \- K1 j9 s5 U6 d# U
"type" => "select",
$ j$ w6 S6 N& y7 E. \! o2 i/ H" T "std" => "Choose a category:",1 _! k/ x2 t/ _: z, N
"options" => $wp_getcat),. V" R; K7 t3 Z9 V6 N
& w& @: s5 {4 W9 ~" ^ g- d array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
$ t8 M9 P7 V. E' i "id" => $shortname."_featured_number1",( O1 K4 \7 V/ W1 i. Z; d& ~
"type" => "select",
9 t. P3 y% _. m1 I8 I "std" => "Number of post:",
+ v* @+ z5 P2 P: `; X+ n "options" => $number_entries)," \( G! x8 N& ~ ]' l
1 F9 ]# J1 Q8 |- e7 _
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",! O4 {& h, W R6 s/ s# {: W: ?
"id" => $shortname."_featured_category_id2",- n+ M( Y* a- e# ]4 l: Z) J1 R* `
"type" => "select",
* I! s/ O! {- }) s' A D3 F "std" => "Choose a category:",$ ?& |' @6 D b
"options" => $wp_getcat),! A, y7 z0 g( \" b/ ~3 k8 {" _
/ T) v% N, c4 g4 m& o9 D: v& } array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
# M* V& r3 F: o3 H' f7 X$ H "id" => $shortname."_featured_number2", E5 Y* C, m: `6 L% V9 v
"type" => "select",7 l0 u1 x6 k: I
"std" => "Number of post:",
2 t- K$ B, l! j0 N; R8 d- c* W "options" => $number_entries),
4 w; A- r# e' j! R; t% H3 y ( F! k: c- X, s/ ]
' X. e! H3 o/ T& V, _+ H array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
! G; ^) e, x, }) `$ d6 H- k; @0 n! {' ] "id" => $shortname."_featured_category_id3",) v6 e6 ^8 c( r
"type" => "select",
2 @# B" P- C9 N H7 T "std" => "Choose a category:",
: H- g* @$ l* c7 P# _8 J3 { "options" => $wp_getcat),9 O1 A6 `6 g4 i, t: C
9 \1 V! r* n+ T2 d, h4 f' \
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
- _8 }- d: d" t! c" }4 H "id" => $shortname."_featured_number3",
% A6 b. y1 T# {! @4 t+ e "type" => "select",3 W! [# i' V5 A0 t
"std" => "Number of post:",
; e2 g0 f' `! E% r* e/ E "options" => $number_entries),
0 M& g0 X2 e2 P$ V) I$ z& `0 s) V! e" T, C8 D
: p7 f( K. D' q2 y) e! X
array( "name" => "</div></div>",
- Q; X/ p0 S8 U, {0 X- u" c "type" => "close",
. q4 h+ R0 h; @! b! i; z$ v ),
6 u; g0 ]) K6 z- T8 U- ?7 C5 y/ e: C) n+ l! F
; u$ |+ w$ {6 m. m
array( "name" => "Google Adsense & Analytics Settings",; P) n% O F2 g$ u$ b m
"type" => "heading",: A3 o3 V- R' h4 u7 ?3 |( ^: P4 K( b
),
( ~/ O6 u. _# M! y3 }3 k
3 \, K* ~! |, w. h; z8 p, g array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
' f$ Z( f3 D: q. s7 m5 t "id" => $shortname."_adsense_loop_activate",
2 W9 [7 Y. |+ G* |4 D2 j "type" => "select",
' U: F, n: w s "std" => "Disable",. X" A1 F4 c% V+ B: |) m# I
"options" => array("Disable", "Enable")),
7 |/ O. N' h) H0 _- f: K
5 u) Y: j: l7 @6 g; w6 q( P array( "name" => "Insert Google Adsense Code For Loops Here<br />0 f+ S& ~+ x* h' _5 Y( }5 S
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",. A* L% I% o* q
"id" => $shortname."_adsense_loop",
* E s& F! Z6 C( t& c7 X4 } "type" => "textarea",
9 L( p. _+ l4 G3 R "std" => "",
5 A4 ?+ I+ M! j1 l ),- B7 Y: c7 w- T& l1 W5 V
5 y" ~. f8 c" H* @ array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>"," _& T6 t( ~' N& \* n
"id" => $shortname."_adsense_single_activate",* C) D7 K7 R( A: R
"type" => "select",
- d) C- w5 k9 A$ ` "std" => "Disable",
a. V3 \5 e; d, A4 _) H "options" => array("Disable", "Enable")),
% D& Q. t2 v$ `3 t# L, p
4 z% u- ?7 R9 V4 Y array( "name" => "Insert Google Adsense Code For Single Page Here<br />! b0 h; A2 ?% D' c, ^' ?2 S, w8 {, _
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",- K. w: s# x6 J7 }6 r. W/ o: e$ \
"id" => $shortname."_adsense_single",
1 |) Z* g% j: [; z* o- C "type" => "textarea",, `4 @ Y+ }4 j H0 \. b
"std" => "",4 F# S& C. x3 c3 Z9 s% z
),
% Y, w: ?' n' T! E8 X/ q- j/ L6 g* o
- P$ E/ [8 I! S% W( Y+ X5 @! U( b7 O
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
7 e% n" B& a$ s' n; V1 ` "id" => $shortname."_google_analytics",7 h4 ] a, Z# [% w4 Q; [% c4 H
"type" => "textarea",
$ v% ^7 a5 a. ?$ x" ^ "std" => "",: @, p. F7 `6 }) z! @
),
, B% V$ g- m4 L! M; E, ?& {) P4 T5 ^' {" R2 Q6 U: q
array( "name" => "</div></div>",
: ]% Q2 j+ _0 J( g% B# u0 b "type" => "close",8 [8 u8 f; C0 @, S6 d; c
),# f) @7 b) e9 V Y
7 P( \, O# c e, y
4 U+ D: _) ~+ F0 v7 o9 h array( "name" => "AddThis Social Bookmarking Settings",1 r9 z$ D# h: I, F% p/ h
"type" => "heading",
4 n+ u+ T6 {0 y* W. F/ t: y ),
7 k- [/ r! U" ~. @3 ~* i' ?' K! y5 W& w% c, y) c2 D X& @- p$ q# Z1 u
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
; ?% C, T" u M& f3 I# t8 y <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",. R) O; {, Y8 y/ `" c+ Q* M: L5 V% Z
"id" => $shortname."_addthis",
; Q# X% z3 L7 @- \0 V! T "type" => "text",
3 n. [8 H. A1 i# a& h; n" C t! a "box" => "social",( {& K4 |% v1 {. X; B8 u
"std" => "",
7 h* l' z6 ^ I" { ),
2 }. |' U+ V. h- U' o
; x, Q! X* |: q6 {/ X7 K) _ array( "name" => "</div></div>",' o( s5 \6 ]9 d# Z F7 X2 I
"type" => "close",) m, }7 p$ f5 e* `7 c
),
, J1 i% H# n( r
! z9 J* l! W5 d: ~# d7 l
: `$ j, @, B# S7 b0 ]$ o: g( S O- ~' m/ X: b6 S' C0 t
array( "name" => "YouTube Video Settings",- `/ n3 Q. y! F; p( T
"type" => "heading",
( P7 x6 N5 Q4 E! T7 _5 c ),
5 B7 D& F+ n- x+ }0 R; E5 T- T0 y3 o# C4 }" J
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) d% J7 X# D1 ^% @' }1 [' }
"id" => $shortname."_emvideo_activate",. @) e( N# o% k4 a/ ]0 {
"type" => "select",
) N# I0 q P* ?! B2 \. n; J "std" => "No",0 t1 M* G& B( U7 g( E! Z
"options" => array("No", "Yes")),0 ]' \ v8 [; N5 g- y* P/ a. H
5 B. V5 E% h1 A1 V+ D% K3 B
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>",
. |! f* _" c2 A2 M* J6 |" T "id" => $shortname."_emvideo",
: P/ @- b$ n# G( M) s "std" => "",# Z7 d4 W6 j) f8 v9 F7 ]5 G; m
"type" => "text"),
) P# \/ f ?7 O* l0 o- w, }5 R- i4 S( m! U8 m& ~ N9 p! x- v
array( "name" => "</div></div>",, w: U3 t( c$ U6 k( @" H
"type" => "close",4 A: q8 e* B- u' q! `
),
9 b8 f" |+ y- U" G1 \! I* T * D0 A% b) i' {1 d, ]* |4 i* C
array( "name" => "Twitter Settings",
7 u; S5 @* `; `; X, I9 Y8 t "type" => "heading",5 T% S5 t7 p; |; }, ~8 I: h
),
+ [, v8 b0 {% [( D2 f" [+ f8 d, e! f9 T
1 ~0 Z0 w& R+ \2 f array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: l$ t) D7 K [6 Z' ` I "id" => $shortname."_twitter_activate",: U/ o4 \3 G; M% j
"type" => "select",
$ \/ m1 k! u' u1 g2 e1 t "std" => "No",
* k) c0 r5 U) \ f0 b; i2 G$ C9 s" X "options" => array("No", "Yes")),
9 M5 D# a7 M9 R0 {2 i% o/ S5 P, h+ |5 }7 A) K* Z. p/ s
array( "name" => "Insert Your Twitter ID here( I! l0 a6 W/ q# k
<br /><em>*leave blank if not necessary</em>
h, n/ f7 S. g' W* s <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",1 @3 L9 i- v! u3 i) X, p' `- i
"id" => $shortname."_twitter",
2 e" R8 _( p5 o# _ "type" => "text",
# _" S- v0 W q. z "box" => "social",
; P) F% Q5 O, C/ v! C+ ? "std" => "",
/ W7 L' e5 H7 `, K$ [' n5 z ),! {- \5 Y+ {# i% H9 [
" n' R. j( N, a
array( "name" => "Enter Twitter Feed Count here
! [2 @2 M4 F k# T6 v <br /><em>*leave blank if not necessary</em>
: I3 D; Q ]) r+ f/ k <br /><em>*Enter How Many Twitter Feed To Display</em>",( n: s; @& C& Y7 ?2 L
"id" => $shortname."_twitter_count",
# T* T$ D: ?& `$ n: {) o "type" => "text",, V: K) T7 j1 |
"box" => "social",
9 b5 U- Y# ?6 \, I/ i/ ] "std" => "",
- {0 ^( @& e3 A; o- P3 P) i ),& O! I! i- M# E' i; H
; O2 q% Q0 {5 f5 ~& r- O array( "name" => "</div></div>",/ N c, L, z0 x
"type" => "close",
: l$ g+ c9 z9 q' q @% I ),
7 ^% R- J0 b8 B; \) [ ! e: w5 P% L* r4 V
! I7 L9 ^. K6 s* t; q; {
array( "name" => "125 x 125 Banners Advertisement Settings",0 y i' k: G5 _& R
"type" => "heading",
; y2 X/ e- Y' Z& R. D6 }) L ),3 H! }1 K$ {( T4 s; N* e) M$ X7 K
& G. M5 P) {9 L0 F1 u0 T( @4 R array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 \' W* A0 v8 i
"id" => $shortname."_sponsor_activate",! f# Q! T7 L) V
"type" => "select",
* y& I; ~* b$ S% Q1 x% O' j "std" => "No",
. I7 p2 x0 E- l* e y. z% s c S "options" => array("No", "Yes")),
* u( A( V8 E4 O. U/ M9 s
N% A. g0 g2 _5 V! N! x* s+ j/ T5 h! }6 B
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
( c) D0 e; ~# ` G8 A; X$ @ "id" => $shortname."_sponsor_banner_one",
* C9 h' e x: @% k. c! j" N "type" => "textarea",: A7 p- w2 k: k4 m
"std" => "",
4 n( S, Y, Y0 C6 Y, k ),
; t# ?& p" n+ [2 Z! e6 q2 v7 N, ^( g1 B P, @
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",7 h6 O3 |- [& G3 ?- j$ K
"id" => $shortname."_sponsor_banner_two",
# ?$ @1 E: G o+ T# d "type" => "textarea",) y& c) U6 k7 @1 k2 C
"std" => "",% i4 L( B/ T: P v. J0 d" K
),) r; [8 A" n2 g
) Z7 X+ ^) j" Q: ` array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",1 K& H. P) J S6 v( _2 h8 C
"id" => $shortname."_sponsor_banner_three",8 Z+ U, F6 c) v' @* c. G
"type" => "textarea",0 b3 ?. e2 J/ q3 v% A
"std" => "",2 U$ d# U3 s+ @) g
),
' d4 _3 D- h) J! j! |% l( L
- i; Y* _3 r5 O, I) i6 ~0 C4 [ array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",) U$ N% U9 x% D: K! J4 J
"id" => $shortname."_sponsor_banner_four",& F' | Q3 y2 b
"type" => "textarea",
5 N; p0 n1 f( D; F. I8 {" o' b "std" => "",3 M# }4 L4 ~2 |) N
),
2 O0 L$ k, q* J( V& _& Z. M$ u8 t' p/ k6 Y) A* K2 P: Q" f* u
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
0 c1 D1 e$ x0 _3 G "id" => $shortname."_sponsor_banner_five",
3 i6 e' {( a5 U# A6 h$ ^ "type" => "textarea",
$ Y. G$ G& c) m- Y; B$ x "std" => "",0 i* L; _, e6 T, B+ E5 k3 x
),) | g( Q e# h2 m, J
" S# c8 _3 s: r5 ]0 _8 o- o# q: Q
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
4 Q- l$ u" R1 p" n& X. E" w3 C8 E "id" => $shortname."_sponsor_banner_six",3 F( ]' ~- V N9 I+ I) k
"type" => "textarea",
+ F! A4 R# Q8 [. k3 O a "std" => "",
, g3 U; e0 ^1 e% d; I8 o& ` ),. u! l& e8 K* Y# u# y9 m2 |
# ^7 T( d9 g" b# q array( "name" => "</div></div>",6 _) I/ a* x6 |- h- E V
"type" => "close",
$ i# l H! j% i+ m% w" y ),
. {. @, `2 K/ ~- [& T2 w2 V4 T7 ?/ d9 \; ?) A
h3 a5 ]' j. `, Q4 {5 g4 {1 d
1 y+ X1 K) X" r' X$ R3 i l);; W& P' S. k8 @
( P/ ?. P) u, @+ h) G: y
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
7 S# d% t1 O9 O4 e6 j" K. h, O; L: S. v" ?) S: Q
echo "<div id=\"admin-options\"> ";7 q/ Z9 M/ o& ~1 ]9 D
# Y: ^8 j* E7 H1 J- Lglobal $themename, $shortname, $options;% u8 i1 Q: ]+ C) Q, W$ Q/ b
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
: F* N+ i, E: rif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';9 v, n2 w5 s8 G4 B
?>5 ]% q6 g4 v$ t+ H, b6 R
: s; V7 d1 o9 |; y+ w; V4 P
<h4><?php echo "$themename"; ?> Theme Options</h4>
3 }. i. G+ h8 J4 I" O) Q8 n0 P( P: U' _2 ]- g, W
<div class="annouce">7 S) Q T8 s! i/ ~7 K& w9 g3 k
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>- E! x$ a7 X2 L+ c
<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>
7 f# B: c/ H( K+ X</div>
h' a* W/ u$ w- m- e3 y- @' x b- E- \7 M T
<form action="" method="post">0 Y2 v/ n% @6 }/ N; v, E0 ~/ U2 N
6 v* J0 x" o( E. l* A0 a<?php foreach ($options as $value) { ?>
* T. c& |% V6 Q& q+ g" w
1 t, E+ y5 r% E% i3 d [! X3 o<?php switch ( $value['type'] ) { case 'heading': ?>0 |: p* E% D: u8 X, \9 ~8 r( ?
+ D/ \+ R' ]/ ^+ l
<div class="get-option">
! p) D4 C* Z: r* G$ c$ f1 o& ?- E2 G( k+ B+ r' W t
<h2><?php echo $value['name']; ?></h2>" Z, s/ r7 f r. y% d6 [* e
8 |& V- J, h z<div class="option-save">
& x: V' H7 Q) m$ V) H2 n: { G$ f# F6 ]& T3 t
<?php
. I8 Z, x# {7 f3 }1 Ebreak;( r" B. w" ?% E$ a
case 'text':
4 v5 t# r# f0 k5 J8 h3 ~7 p9 ^& m?>
$ g3 @7 g1 [# y) l
' p5 f/ Z+ e2 J<div class="description"><?php echo $value['name']; ?></div>
* D3 V5 H% Q- v<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
D: e1 n% { V: b% n& c. m$ ?% N0 U" Q% y6 f' W3 k- l( W ^
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>5 ^# c3 @; L. C5 c- M4 s* D: B
2 f7 `1 [: y9 V4 L+ U0 n
<?php3 F; i/ q, R6 _+ X! ?# h2 [% i
break;
1 { @ K( Q: _' A' W0 w, tcase 'select':
4 v+ }6 B+ ^# E4 L6 p; M1 J?>
6 O5 K9 |, y, u0 X9 K. \
+ X4 E& M: Z& P% z6 {' I<div class="description"><?php echo $value['name']; ?></div>
6 f i" l' l ?$ N<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">8 k% Z( f. M9 x0 M5 U$ h
<?php foreach ($value['options'] as $option) { ?>
' i0 K9 @3 {! q1 g" b) w3 K6 v6 L<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
S& V( y" b$ m) G6 L1 s$ k<?php } ?>1 o3 O8 y; a" [( |# M! l, \8 E! x$ A. o
</select>* l1 H" E( M4 u2 t: H0 v
</p>8 O, S! b4 D( V0 d. v8 S
4 Y5 b) p- `8 S
<?php
1 n4 T# Q$ |! K$ q, [# Y) Cbreak;
7 J, K# u# e* d9 }, W" rcase 'textarea':" D4 C: d; x; K6 d: x, \5 G3 h
$valuex = $value['id'];: N2 s' l2 T0 ]& r7 f
$valuey = stripslashes($valuex);* e8 b9 c+ ]1 ]9 B7 i$ F. I5 ]
$video_code = get_settings($valuey);
! W. P* l0 R; Z5 Y?>
; H3 G3 I# O. Q8 ~3 {3 L' ^8 L4 v! _6 r8 ?2 @ ^5 L
<div class="description"><?php echo $value['name']; ?></div>
' r; O/ I3 i1 O1 H- t<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
# E6 u1 N% w: A# s4 G: b R3 D0 i" B
9 C5 c& f6 C. m: @) eelse { echo $value['std']; } ?></textarea></p> l$ A1 A7 k, M' T8 Z v9 w
7 ]- N) m8 b# O! K( `) s4 f; k
<?php& R6 g% z1 Z2 i X, {! y: |
break;2 n( I% G1 K+ T6 Q) z" r
case 'close':
2 D8 k& D$ x3 _3 T) p3 @' F& G?>
. g' J' U# Y3 p$ Q+ q7 N* Q! @+ ?, i
<div class="clearfix"></div>
5 {' \5 H/ U9 b8 E</div><!-- OPTION SAVE END -->8 c' N$ i! |0 O( D" {/ k+ _3 Y" u0 B% b
. w& g0 u! ^" a1 U7 S" K+ N; L<div class="clearfix"></div>
! c5 ~/ j3 c/ T0 M. x' g+ D</div><!-- GET OPTION END -->: B# U* M( w+ v1 g/ G0 O# K
$ i: c B! e( Q: l7 Z+ Q9 _
<?php0 V5 }, W/ T) P8 W, e
break;
+ M0 l& h& J2 J) Kdefault;
3 b0 h# O& t7 V8 r% B% o?>
3 i8 Y W2 `4 Q8 F! |$ r' t4 ^4 G; }) m0 ~
9 ?( ?7 ?% r9 `1 \; Q; L
' G9 R* g8 _7 f7 @<?php
- Q6 v# C# J. C4 {break; } ?>4 y3 \+ [& _% U# J; c! J% C* `- I: P" A
2 j: l8 p: R) r8 c+ d% K- T: } j<?php } ?>
/ {/ u" n* B8 h9 i' R2 A, Y6 ] ^- \8 @+ i) M- f& x
<p class="save-p">, D6 M8 b$ a( ^3 z# |1 p
<input name="save" type="submit" class="sbutton" value="Save Options" />- I8 ~1 X* L+ k& T& J' p
<input type="hidden" name="action" value="save" />1 k$ {( F5 i$ C: `+ ?
</p>7 y$ F9 R2 ?$ F I
</form>
+ o' _( B, ]3 S$ M& F: w \, R, R6 A8 c' ?. Q& _7 N O7 B
<form method="post">
- n& S- t R, K# s( z" ^<p class="save-p">5 a$ y5 a2 v- A' k. ~
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
6 ?4 i) X6 ?# Y( B+ o; ^6 q$ y5 c<input type="hidden" name="action" value="reset" />4 C; e; T$ V' U; R0 t) [6 r6 C
</p>; [. ?& q) h+ d0 W" c' I$ Z
</form># \" l6 D! k' t! b; Q5 Q. p
/ \# d; `: n' N! Z: [. \
</div><!-- ADMIN OPTIONS END -->
3 u$ w( X' F8 x& D9 \# S/ D8 J w* O3 c8 o" L7 R/ }7 c
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
3 }, @8 @" j( X9 C+ c
0 d- n2 M4 h- W- J/ O) W' l; ~function mytheme_admin_register() {+ ~! P; R& }* z2 J
global $themename, $shortname, $options;
$ B/ k1 C- S) K' sif ( $_GET['page'] == basename(__FILE__) ) {/ [5 O- y6 V: _6 c# Y
if ( 'save' == $_REQUEST['action'] ) {
- J$ S/ [& ? \8 q- Jforeach ($options as $value) {
* V+ s# T G$ X: s- wupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
: M4 w. b7 N; \! I* t0 O& xforeach ($options as $value) {
: _; e# {, U# @- Y+ b( I# g" jif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
% n' o4 t+ K" i1 Y, Zheader("Location: themes.php?page=functions.php&saved=true");
! j! A; A/ J% q; i' i" }! ^die;
5 Q! @: {8 ?6 @7 H7 O} else if( 'reset' == $_REQUEST['action'] ) {. I _. E/ [. E* w b
foreach ($options as $value) {* B" M9 u* ]- P6 F! w
delete_option( $value['id'] ); }
! o6 I5 J& f# Zheader("Location: themes.php?page=functions.php&reset=true");
, C" R8 ]" T, L! b, v7 u( l Ldie;
. l: t% `- Z5 A; I1 f! u( ~}& {1 |" ^) a, h' p: w$ v1 |" s4 S
}
# ~! s% g4 v6 l# ?% l; Qadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');# a. W4 y# ^9 q8 u) E( j2 V) z1 w
}5 L0 R5 c9 S" r
, C T8 Q9 n' ofunction mytheme_admin_head() { ?>
! ]+ P+ X9 j& W. |: G7 [# v<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />, m9 P3 _/ z5 g0 f6 A6 |# S( t
<?php }3 S! \3 }4 F( N0 R
|
|