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