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