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