|
|

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