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