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