|
|

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