|
|

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