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