|
|

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