|
|

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