|
|

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