|
|

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