|
|

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